Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Changeset [89f4f7bd2000767025f65ac4aa62769d871a7e8f] by Douglas Creager

Revision 89f4f7bd2000767025f65ac4aa62769d871a7e8f, committed by Douglas Creager · March 3rd, 2009 @ 11:43 PM

Simple datatypes

This patch introduces support for “simple” datatype statements — i.e., those whose constructors do not take any data values. So, in the following:

datatype SimpleColour = Red | Green | Blue datatype T = A.{0..3} | B.{4..7}

SimpleColour is a simple datatype, whereas T is not.

The SimpleColour definition creates four bindings: Red, Green, and Blue all resolve to a new “constructor value”, which just records which of the data constructors was used to create a particular value. SimpleColour resolves to a set containing all three constructor values.

Lighthouse: [#21] http://github.com/hst/hst/commit...

7 changed files

  • M cspm/src/HST/CSPM/Bind.hs
  • M cspm/src/HST/CSPM/Definitions.lhs
  • M cspm/src/HST/CSPM/Evaluate.hs
  • M cspm/src/HST/CSPM/Parser.hs
  • M cspm/src/HST/CSPM/Parser.ly
  • M cspm/src/HST/CSPM/Types.hs
  • M cspm/tests/expressions/test-types.sh