module Data.Vector.HFixed.TypeFuns (
Proxy(..)
, proxy
, unproxy
, (++)()
, Len
, Head
, HomList
, Wrap
) where
#if __GLASGOW_HASKELL__ >= 708
import Data.Typeable (Proxy(..))
#endif
import Data.Vector.Fixed.Cont (S,Z)
#if __GLASGOW_HASKELL__ < 708
data Proxy a = Proxy
#endif
proxy :: t -> Proxy t
proxy _ = Proxy
unproxy :: Proxy t -> t
unproxy _ = error "Data.Vector.HFixed.Class: unproxied value"
type family (++) (xs :: [α]) (ys :: [α]) :: [α]
type instance (++) '[] ys = ys
type instance (++) (x ': xs) ys = x ': xs ++ ys
type family Len (xs :: [α]) :: *
type instance Len '[] = Z
type instance Len (x ': xs) = S (Len xs)
type family Head (xs :: [α]) :: α
type instance Head (x ': xs) = x
type family HomList n (a :: α) :: [α]
type instance HomList Z a = '[]
type instance HomList (S n) a = a ': HomList n a
type family Wrap (f :: α -> β) (a :: [α]) :: [β]
type instance Wrap f '[] = '[]
type instance Wrap f (x ': xs) = (f x) ': (Wrap f xs)