24 Jul
2007
24 Jul
'07
6:05 p.m.
"Claus Reinke" <claus.reinke@talk21.com> schrieb im Newsbeitrag news:004a01c7cde1$04b190f0$2e3f8351@cr3lt...
though I'm extremely dubious about the utility of the "Maybe" patterns.
actually, they are the main thing that interests me about view patterns!-) type Typ
unit :: Typ -> Maybe () arrow :: Type -> Maybe (Typ,Typ) size :: Typ -> Integer size (unit -> ()) = 1 size (arrow -> (t1,t2)) = size t1 + size t2
closer to ordinary patterns, with the lowercase and the '->' hinting that there is computation before matching (well, '=>', according to the new proposal).
claus Though I guess you would not object to:
size (unit -> Just ()) = 1 size (arrow -> Just (t1,t2)) = size t1 + size t2 ? Rene.