Copyright | (c) Edward Kmett and Dan Doel 2012-2014 |
---|---|
License | BSD3 |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module supplies a number of builtin types intrinsic to the Ermine language.
>>>
infer int
*
>>>
infer (list list)
*** Exception: kind mismatch: Type (HardKind Star) /= Type (HardKind Star) :-> Type (HardKind Star)
- class Builtin t where
- builtin_ :: Builtin t => String -> t
- int :: Builtin t => t
- long :: Builtin t => t
- byte :: Builtin t => t
- short :: Builtin t => t
- float :: Builtin t => t
- double :: Builtin t => t
- inth :: Builtin t => t
- longh :: Builtin t => t
- integer :: Builtin t => t
- bool :: Builtin t => t
- string :: Builtin t => t
- char :: Builtin t => t
- stringh :: Builtin t => t
- list :: Builtin t => t
- maybe_ :: Builtin t => t
- ee :: Builtin t => t
- io :: Builtin t => t
- equality :: Builtin t => t
- functor :: Builtin t => t
- lame :: Builtin t => t
- fromInteg :: Builtin t => t
- anyType :: Annot a
Builtin Types
This class allows for overloading of builtin types, so they can be used directly a nice DSL for specifying types borrowing application from Haskell for the application of types.
Numerics
Booleans
Text
Containers
>>>
infer list
* -> *
>>>
infer (list int)
*
>>>
infer (tup [int, list int])
*
IO
Type Equality
equality :: Builtin t => t Source
>>>
infer equality
a -> a -> *
>>>
infer (equality equality)
(a -> a -> *) -> *
Classes
functor :: Builtin t => t Source
>>>
infer functor
(* -> *) -> Γ
>>>
infer (equality functor)
((* -> *) -> Γ) -> *
This is a placeholder typeclass we're using until we get class declaration parsing implemented
>>>
infer lame
* -> Γ