Changes between Version 6 and Version 7 of TypeFunctionsSynTC


Ignore:
Timestamp:
Dec 7, 2006 7:58:36 PM (7 years ago)
Author:
chak
Comment:

Fixed syntax in introductory example

Legend:

Unmodified
Added
Removed
Modified
  • TypeFunctionsSynTC

    v6 v7  
    2424data Succ n 
    2525data List a n where 
    26   Nil :: List a Zero 
     26  Nil  :: List a Zero 
    2727  Cons :: a -> List a m -> List a (Succ m) 
    2828 
    29 type add :: * -> * -> * 
    30      add Zero x = x 
    31      add (Succ x) y = Succ (add x y) 
    32  
    33 append :: List a l -> List a m -> List a (add l m) 
     29type family Add :: * -> * -> * 
     30type instance Add Zero     y = y 
     31type instance Add (Succ x) y = Succ (Add x y) 
     32 
     33append :: List a l -> List a m -> List a (Add l m) 
    3434append Nil xs = xs 
    3535append (Cons x xs) ys = Cons x (append xs ys)