Safe Haskell | None |
---|---|
Language | Haskell2010 |
Useful abstractions for type level programming using. This reimplements parts of the singletons library, which is just too heavy of a dependency to carry around, when only three small types are used of it.
Synopsis
- type family (ma :: monad a) >>= (f :: a ~> (monad b :: Type)) :: monad b
- type (>>) ma mb = ma >>= Const' mb
- type family (f :: m (a ~> b)) <*> (ma :: m a) :: m b where ...
- data Pair'' :: a ~> (b ~> (a, b))
- data Pair' :: a -> b ~> (a, b)
- data Cons'' :: a ~> ([a] ~> [a])
- data Cons' :: a -> [a] ~> [a]
- data TyCon1 :: (a -> b) -> a ~> b
- data TyCon2 :: (a -> b -> c) -> a ~> (b ~> c)
- data (<$>$$) :: (a ~> b) ~> (m a ~> m b)
- data (<$>$) :: (a ~> b) -> m a ~> m b
- type family (f :: a ~> b) <$> (ma :: m a) :: m b
- data Flip' :: (a ~> (b ~> c)) ~> (b ~> (a ~> c))
- data Flip :: (a ~> (b ~> c)) -> b ~> (a ~> c)
- data Flip_ :: (a ~> (b ~> c)) -> b -> a ~> c
- type family Flip__ (f :: a ~> (b ~> c)) (y :: b) (x :: a) :: c where ...
- data Compose'' :: (b ~> c) ~> ((a ~> b) ~> (a ~> c))
- data Compose' :: (b ~> c) -> (a ~> b) ~> (a ~> c)
- data Compose :: (b ~> c) -> (a ~> b) -> a ~> c
- type family Compose_ (f :: b ~> c) (g :: a ~> b) (x :: a) :: c where ...
- type family Const (a :: t) (b :: t') :: t where ...
- data Const' :: a -> b ~> a
- data Const'' :: a ~> (b ~> a)
- data TyFun :: Type -> Type -> Type
- type (~>) a b = TyFun a b -> Type
- type family Apply (f :: a ~> b) (x :: a) :: b
Documentation
type family (ma :: monad a) >>= (f :: a ~> (monad b :: Type)) :: monad b Source #
Bind to actions.
type (>>) ma mb = ma >>= Const' mb Source #
Execute one action and then the next, ignore the result of the first.
type family (f :: m (a ~> b)) <*> (ma :: m a) :: m b where ... Source #
Execute an action that returns a function than map function over the result of the next action.
Tuple construction
List construction
Convert data types to Partially applicable type functions
Execute an action and map a pure function over the result.
Flip Type Functions
Type Function composition
Type-Level const
Defunctionalization
data TyFun :: Type -> Type -> Type Source #
Instances
type Apply (Cons'' :: TyFun a ([a] ~> [a]) -> Type) (x :: a) Source # | |
type Apply (Const'' :: TyFun a1 (b ~> a1) -> Type) (a2 :: a1) Source # | |
type Apply (Pair'' :: TyFun a (b ~> (a, b)) -> Type) (x :: a) Source # | |
type Apply (Flip f :: TyFun b (a ~> c) -> Type) (y :: b) Source # | |
type Apply (TyCon2 f :: TyFun a1 (a2 ~> b) -> Type) (x :: a1) Source # | |
type Apply (Flip' :: TyFun (a ~> (b ~> c)) (b ~> (a ~> c)) -> Type) (f :: a ~> (b ~> c)) Source # | |
type Apply ((<$>$$) :: TyFun (a ~> b) (m a ~> m b) -> Type) (f :: a ~> b) Source # | |
type Apply (Compose'' :: TyFun (b ~> c) ((a ~> b) ~> (a ~> c)) -> Type) (f :: b ~> c) Source # | |
type Apply (Compose' f :: TyFun (a ~> b) (a ~> c) -> Type) (g :: a ~> b) Source # | |
type family Apply (f :: a ~> b) (x :: a) :: b Source #
Instances
type Apply (Const' a :: TyFun t' t -> Type) (b :: t') Source # | |
type Apply (TyCon1 f :: TyFun a b -> Type) (x :: a) Source # | |
Defined in Test.TypeSpec.Internal.Apply | |
type Apply (Compose f g :: TyFun a c -> Type) (x :: a) Source # | |
type Apply (Flip_ f y :: TyFun a c -> Type) (x :: a) Source # | |
type Apply (Cons' x :: TyFun [a] [a] -> Type) (xs :: [a]) Source # | |
Defined in Test.TypeSpec.Internal.Apply | |
type Apply ((<$>$) f :: TyFun (m a) (m b) -> Type) (x :: m a) Source # | |
type Apply (Cons'' :: TyFun a ([a] ~> [a]) -> Type) (x :: a) Source # | |
type Apply (Const'' :: TyFun a1 (b ~> a1) -> Type) (a2 :: a1) Source # | |
type Apply (Pair'' :: TyFun a (b ~> (a, b)) -> Type) (x :: a) Source # | |
type Apply (Pair' x :: TyFun k1 (k2, k1) -> Type) (y :: k1) Source # | |
type Apply (Flip f :: TyFun b (a ~> c) -> Type) (y :: b) Source # | |
type Apply (TyCon2 f :: TyFun a1 (a2 ~> b) -> Type) (x :: a1) Source # | |
type Apply (Flip' :: TyFun (a ~> (b ~> c)) (b ~> (a ~> c)) -> Type) (f :: a ~> (b ~> c)) Source # | |
type Apply ((<$>$$) :: TyFun (a ~> b) (m a ~> m b) -> Type) (f :: a ~> b) Source # | |
type Apply (Compose'' :: TyFun (b ~> c) ((a ~> b) ~> (a ~> c)) -> Type) (f :: b ~> c) Source # | |
type Apply (Compose' f :: TyFun (a ~> b) (a ~> c) -> Type) (g :: a ~> b) Source # | |