ermine-0.6: Ermine

Copyright(c) Edward Kmett and Dan Doel 2012-2014
LicenseBSD3
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Ermine.Builtin.Type

Contents

Description

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)

Synopsis

Builtin Types

class Builtin t where Source

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.

Methods

builtin :: Ord k => Kind k -> String -> t Source

Instances

Builtin Global 
Builtin HardType 
(Builtin' y, (~) * x (Type (K y) (T y))) => Builtin (x -> y) 
Builtin (Type k t) 

builtin_ :: Builtin t => String -> t Source

Create a Builtin Type of Kind star.

Numerics

int :: Builtin t => t Source

>>> infer int
*

long :: Builtin t => t Source

>>> infer long
*

byte :: Builtin t => t Source

>>> infer byte
*

short :: Builtin t => t Source

>>> infer short
*

float :: Builtin t => t Source

>>> infer float
*

double :: Builtin t => t Source

>>> infer double
*

inth :: Builtin t => t Source

>>> infer inth
#

longh :: Builtin t => t Source

>>> infer longh
#

integer :: Builtin t => t Source

>>> infer integer
*

Booleans

bool :: Builtin t => t Source

>>> infer bool
*

Text

string :: Builtin t => t Source

>>> infer string
*

char :: Builtin t => t Source

>>> infer char
*

Containers

list :: Builtin t => t Source

>>> infer list
* -> *
>>> infer (list int)
*
>>> infer (tup [int, list int])
*

maybe_ :: Builtin t => t Source

>>> infer maybe_
* -> *
>>> infer (maybe_ int)
*

ee :: Builtin t => t Source

>>> infer ee
*

IO

io :: Builtin t => t Source

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)
((* -> *) -> Γ) -> *

lame :: Builtin t => t Source

This is a placeholder typeclass we're using until we get class declaration parsing implemented

>>> infer lame
* -> Γ

Annotations

anyType :: Annot a Source

A type annotation that can be applied to anything.