{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module Funflow.Type.Family.List where
type Ø = '[]
type (:<) = '(:)
infixr 5 :<
type Only a = '[a]
type family Null (as :: [k]) :: Bool where
Null Ø = 'True
Null (a :< as) = 'False
type family (as :: [k]) ++ (bs :: [k]) :: [k] where
Ø ++ bs = bs
(a :< as) ++ bs = a :< (as ++ bs)
infixr 5 ++
type family Concat (ls :: [[k]]) :: [k] where
Concat Ø = Ø
Concat (l :< ls) = l ++ Concat ls