Re: [Haskell] Re: View patterns in GHC: Request for feedback
25 Jul
2007
25 Jul
'07
2:33 a.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
6952
Age (days ago)
6952
Last active (days ago)
0 comments
1 participants
participants (1)
-
Claus Reinke