Re: [Haskell] Re: View patterns in GHC: Request for feedback

2007-07-25 Thread Claus Reinke
The whole point of a view is that you make views that are semantically useful. data UsefulView = Unit | Arrow Type Type usefulView :: Type - UsefulView size :: Type - Integer size (usefulView - Unit) = 1 size (usefulView - Arrow t1 t2) = size t1 + size t2 yes, but my point (of view;) was

[Haskell] Re: View patterns in GHC: Request for feedback

2007-07-24 Thread Rene de Visser
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

Re: [Haskell] Re: View patterns in GHC: Request for feedback

2007-07-24 Thread ajb
G'day all. Claus Reinke [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] type Typ unit :: Typ - Maybe () arrow :: Type - Maybe (Typ,Typ) size :: Typ - Integer size (unit - ()) = 1 size (arrow - (t1,t2)) = size t1 + size t2 The whole point of a view

[Haskell-cafe] Re: [Haskell] Re: View patterns in GHC: Request for feedback

2007-07-24 Thread Claus Reinke
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