User:Zzo38/Proposal for more-notation

From HaskellWiki
< User:Zzo38
Revision as of 20:27, 27 August 2011 by Zzo38 (talk | contribs) (New page: This document is proposal for more-notation in Haskell. ==Syntax== Anywhere that a more-notation is allowed (see Uses), you can use the syntax: * <tt>more</tt> ''[''<tt>(</tt>''name_of_en...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This document is proposal for more-notation in Haskell.

Syntax

Anywhere that a more-notation is allowed (see Uses), you can use the syntax:

  • more [(name_of_enumeration)] more_name {parameters}
  • name_of_enumeration: A name of any type which is an enumeration. It can be another one using more-notation, but it must be able to fully determine it before this more-notation can be fully determined.
  • more_name: A capitalized name. It uses the same namespace as constructors, so you are not allowed to have a constructor of the same name (although it is OK to have types of the that name).
  • parameters: Optional lowercased names. These names are in local scope, and may already exist in this scope, although they do not have to.

A more-declaration is a module-level declaration of this syntax:

  • [ numeric_literal | (enumeration_constructor) ] more_name {parameters} = contents { | contents } ;

Semantics

Uses

Do-blocks

Case alternatives

Datatype declarations

Fields

Lists

Combining with Template Haskell