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.
- type family (ma :: monad a) >>= (f :: TyFunData (a :: Type) (monad b :: Type)) :: monad b
- type (>>) ma mb = ma >>= Const' mb
- type family (f :: m (a ~> b)) <*> (ma :: m a) :: m b where ...
- 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 TyCon1 :: (a -> b) -> a ~> b
- data TyCon2 :: (a -> b -> c) -> a ~> (b ~> c)
- type family Apply (f :: a ~> b) (x :: a) :: b
- data TyFun :: Type -> Type -> Type
- type TyFunData a b = TyFun a b -> Type
- type (~>) a b = TyFun a b -> Type
- data Cons'' :: a ~> ([a] ~> [a])
- data Cons' :: a -> [a] ~> [a]
- data Pair'' :: a ~> (b ~> (a, b))
- data Pair' :: a -> b ~> (a, b)
- type family Const (a :: t) (b :: t') :: t where ...
- data Const' :: a -> TyFunData b a
- data Const'' :: TyFunData a (TyFunData b a)
- 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 ...
Documentation
type family (ma :: monad a) >>= (f :: TyFunData (a :: Type) (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.
data (<$>$$) :: (a ~> b) ~> (m a ~> m b) Source #
Execute an action and map a pure function over the result.
type family Apply (f :: a ~> b) (x :: a) :: b Source #
type Apply t' t (Const' t t' a) b Source # | |
type Apply a b (TyCon1 a b f) x Source # | |
type Apply a c (Compose b c a f g) x Source # | |
type Apply a c (Flip_ a b c f y) x Source # | |
type Apply a ((~>) [a] [a]) (Cons'' a) x Source # | |
type Apply a (TyFunData b a) (Const'' a b) a1 Source # | |
type Apply a ((~>) b (a, b)) (Pair'' a b) x Source # | |
type Apply k1 (k, k1) (Pair' k k1 x) y Source # | |
type Apply b ((~>) a c) (Flip a b c f) y Source # | |
type Apply a ((~>) a1 b) (TyCon2 a a1 b f) x Source # | |
type Apply [a] [a] (Cons' a x) xs Source # | |
type Apply (m a) (m b) ((<$>$) a b m f) x Source # | |
type Apply ((~>) b c) ((~>) ((~>) a b) ((~>) a c)) (Compose'' b c a) f Source # | |
type Apply ((~>) a ((~>) b c)) ((~>) b ((~>) a c)) (Flip' a b c) f Source # | |
type Apply ((~>) a b) ((~>) (m a) (m b)) ((<$>$$) a b m) f Source # | |
type Apply ((~>) a b) ((~>) a c) (Compose' b c a f) g Source # | |
data TyFun :: Type -> Type -> Type Source #
type Apply a ((~>) [a] [a]) (Cons'' a) x Source # | |
type Apply a (TyFunData b a) (Const'' a b) a1 Source # | |
type Apply a ((~>) b (a, b)) (Pair'' a b) x Source # | |
type Apply b ((~>) a c) (Flip a b c f) y Source # | |
type Apply a ((~>) a1 b) (TyCon2 a a1 b f) x Source # | |
type Apply ((~>) b c) ((~>) ((~>) a b) ((~>) a c)) (Compose'' b c a) f Source # | |
type Apply ((~>) a ((~>) b c)) ((~>) b ((~>) a c)) (Flip' a b c) f Source # | |
type Apply ((~>) a b) ((~>) (m a) (m b)) ((<$>$$) a b m) f Source # | |
type Apply ((~>) a b) ((~>) a c) (Compose' b c a f) g Source # | |