Version 12 (modified by benl, 5 years ago)

--

Parsing for kinds and types is implemented in http://code.haskell.org/ddc/ddc-head/src/Source/Parser/Type.hs

Kinds

Kind
    ::=  SimpleKind
     |   SimpleKind -> Kind

SimpleKind
    ::=  (  Kind  ) 
     |   *                      -- value type kind
     |   %                      -- region kind
     |   !                      -- effect kind
     |   $                      -- closure kind
     |   +                      -- witness kind
  


Types

Type
    ::=  SimpleType
     |   forall  TyVarKind+  .  ConstrainedType

TyVarKind 
    ::=  TyVar  
     |   (  TyVar  ::  Kind  )               -- check this
  
ConstrainedType
    ::=                 SimpleType  (:-  Constraint  ,Constraint*)?
     |   Context    =>  SimpleType  (:-  Constraint  ,Constraint*)?
     |   HsContext  =>  SimpleType  (:-  Constraint  ,Constraint*)?

Context
    ::=  ClassConstraint  =>ClassConstraint*

HsContext 
    ::=  (  ClassConstraint  ,ClassConstraint*  )

SimpleType
    ::=