Slide 40
Slide 40 text
The Idea
These smart constructors can be encountered by:
Regular functions
Type class methods
Pattern synonymns
9
Embedded Pattern Matching, McDonell T.L., Meredith, J.D, and Keller G.
instance Num (Exp a) where
(+) = PrimApp PrimAdd
pattern Maybe_
: :
Exp a
- >
Exp (Maybe a)
constant
: :
Int
- >
Exp Int
constant = Lit