Copyright | Dennis Gosnell 2017 |
---|---|
License | BSD3 |
Maintainer | Dennis Gosnell (cdep.illabout@gmail.com) |
Stability | experimental |
Portability | unknown |
Safe Haskell | Safe |
Language | Haskell2010 |
Additional helpers.
Documentation
type family Snoc (as :: [k]) (b :: k) where ... Source #
A type-level snoc
.
Append to an empty list:
>>>
Refl :: Snoc '[] Double :~: '[Double]
Refl
Append to a non-empty list:
>>>
Refl :: Snoc '[Char] String :~: '[Char, String]
Refl
type family ReturnX x as where ... Source #
Change a list of types into a list of functions that take the given type
and return x
.
>>>
Refl :: ReturnX Double '[String, Int] :~: '[String -> Double, Int -> Double]
Refl
Don't do anything with an empty list:
>>>
Refl :: ReturnX Double '[] :~: '[]
Refl
>>>
import Data.Type.Equality ((:~:)(Refl))