"Claus Reinke" <[EMAIL PROTECTED]> schrieb im Newsbeitrag 
news:[EMAIL PROTECTED]
>> 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. 



_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to