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
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
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
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