Portability | see LANGUAGE pragmas (... GHC) |
---|---|
Stability | experimental |
Maintainer | nicolas.frisby@gmail.com |
Safe Haskell | None |
Some type-level programming basics.
- data Proxy a = Proxy
- type Equal a b = IsEQ (SpineCompare a b)
- derive_data :: Name -> Q [Dec]
- derive_pro :: Name -> Q [Dec]
- data Nat
- data SingNat where
- type Length list = Length' Z list
- type family Length' acc list :: Nat
- type family Append x y :: [k]
- type family App fn t :: *
- newtype Constant a t = Constant a
- data Vec where
- vCarrying :: Proxy f -> Vec ts f -> Vec ts f
- class VFunctor c ts where
- class TrivCon a
- trivCon :: Proxy TrivCon
- class VInitialize c ts where
- vInitialize :: Proxy c -> Proxy f -> (forall t. c t => Proxy t -> App f t) -> Vec ts f
- cvInitialize :: Proxy c -> (forall t. c t => Proxy t -> a) -> CVec ts a
- newtype CVec ts a = CVec {}
- cvec2list :: CVec ts a -> [a]
- class VRepeat ts where
- data Diag_ f g t = Diag_
- class VZip ts where
- cvZipWith :: forall a b c ts. (a -> b -> c) -> CVec ts a -> CVec ts b -> CVec ts c
- data Idx where
- class IndexInto n ts where
- cvAt :: forall ts a. CVec ts a -> Idx ts -> a
- cvUpd :: forall ts a. CVec ts a -> Idx ts -> (a -> a) -> CVec ts a
- class VEnum ts where
- cvAddIndexes :: VEnum ts => CVec ts a -> CVec ts (Idx ts, a)
- type family IsJust x :: Bool
- type family MaybePlus1 x y :: Maybe k
- type family MaybeMap f x :: Maybe l
- type family If c a b :: k
- encode :: Serialize a => a -> Type
- type SpineCompare l r = Compare * (Spine k l) (Spine k1 r)
Documentation
type Equal a b = IsEQ (SpineCompare a b)Source
Convenient synonym. type Equal a b =
IsEQ
(SpineCompare
a b)
derive_data :: Name -> Q [Dec]Source
derive_pro :: Name -> Q [Dec]Source
class VInitialize c ts whereSource
vInitialize :: Proxy c -> Proxy f -> (forall t. c t => Proxy t -> App f t) -> Vec ts fSource
cvInitialize :: Proxy c -> (forall t. c t => Proxy t -> a) -> CVec ts aSource
VInitialize k c ([] k) | |
(c t, VInitialize k c ts) => VInitialize k c (: k t ts) |
Re-exports
Type-level Maybe
type family MaybePlus1 x y :: Maybe kSource
Type-level mplus
for Maybe
.
encode :: Serialize a => a -> Type
Encode uses the cereal
package serializer to encode the value and then
uses type-digits
to reflect it as a type-level numeral.
type SpineCompare l r = Compare * (Spine k l) (Spine k1 r)