[Haskell-beginners] EmptyDataDecls

Kim-Ee Yeoh ky3 at atamo.com
Wed Apr 3 16:38:10 CEST 2013


On Wed, Apr 3, 2013 at 9:01 PM, Philippe Sismondi <psismondi at arqux.com> wrote:
> Can anyone point me in the direction of some explanatory material on the motivation behind empty data declarations?

You could start here:

https://github.com/yairchu/red-black-tree/blob/master/RedBlackTree.hs

The big picture is defining constants.

A declaration like "data Bool = True | False" defines constants at the
term-level. Terms are always typed.

A declaration like "data Z" defines constants at the type-level. Types
are always kinded, typically of kind * (what Z is). The recent
introduction of a Constraint kind expands the possibilities of
type-level programming. Same for polymorphic kinds.

-- Kim-Ee



More information about the Beginners mailing list