Conor McBride <[EMAIL PROTECTED]> writes:

>   P x y z = C x (y, [z])

Isn't this idea very similar to views, and pattern-guards?
For instance, you could rewrite your example thus:

data EffectView x = Bang
                  | Bing x
                  | Dull x

view :: MyEffect x -> EffectView x
view (Comp Nothing)                         = Bang
view (Comp (Just (Prod (Any True), Id x)))  = Bing x
view (Comp (Just (Prod (Any False), Id x))) = Dull x

my_function e
    | Bang   <- view effect  = ...
    | Bing x <- view effect  = ... x ...
    | Dull x <- view effect  = ... x ...

Regards,
    Malcolm
_______________________________________________
Haskell-prime mailing list
[email protected]
http://haskell.org/mailman/listinfo/haskell-prime

Reply via email to