Re: [Haskell] Re: View patterns in GHC: Request for feedback
24 Jul
2007
24 Jul
'07
2:33 p.m.
unit :: Typ -> Maybe () arrow :: Type -> Maybe (Typ,Typ) size :: Typ -> Integer size (unit -> ()) = 1 size (arrow -> (t1,t2)) = size t1 + size t2
Though I guess you would not object to:
size (unit -> Just ()) = 1 size (arrow -> Just (t1,t2)) = size t1 + size t2 ?
actually, i might!-) it is not just that, in general, you have to invent and declare those intermediate view types, but that their use obscures the overall pattern, once you start nesting abstract and concrete patterns (and if you don't nest them, view patterns don't add much). claus
6682
Age (days ago)
6682
Last active (days ago)
0 comments
1 participants
participants (1)
-
Claus Reinke