Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
This module adds some meaningfull type operations that are of use throughout all the project.
Documentation
type family ShapeProduct (s :: [Nat]) :: Nat where ... Source #
Multiplies all numbers on a list of natural numbers
ShapeProduct '[] = 1 | |
ShapeProduct (m ': s) = m * ShapeProduct s |
type family TypeEquals (s1 :: Type) (s2 :: Type) :: Bool where ... Source #
Compares two types in kinds level
TypeEquals s s = True | |
TypeEquals _ _ = False |
type family TypeEquals' s1 s2 :: Type where ... Source #
Compares two types in kinds level and raises error if they don't match
TypeEquals' s s = s | |
TypeEquals' s1 s2 = TypeError (((Text "Couldn't match the type " :<>: ShowType s1) :<>: Text " with type ") :<>: ShowType s2) |