liboleg-2010.1.10.0: An evolving collection of Oleg Kiselyov's Haskell modules

Lambda.CFG3EN

Description

Introducing type constants

We wish to outlaw terms such as bad_sentence in CFG2EN.hs, even though there may be an interpretation that accepts these bad terms. We really wish our terms represent all and only valid CFG derivations. We accomplish this goal here. Our approach is reminiscent of LCF.

Synopsis

Documentation

data S Source

data NP Source

data VP Source

data TV Source

data EN a Source

Parameterized types: cf notation:

 <string,features> in

the Minimalist Grammar

Constructors

EN 

Fields

unEN :: String
 

Instances

Show (EN a) 

mary :: EN NPSource

One may think of the above data declaration as defining an isomorphism between EN values and Strings. The functions EN and unEN (what is their type?) witness the isomorphism. It helps to look at their composition.

r2 :: EN TV -> EN NP -> EN VPSource

r1 :: EN NP -> EN VP -> EN SSource