I love Simon's suggestion. It gives me all the right vibes. And <- seems to
me to be the right connective to use.

At the risk of beating my hobby horse, let's not think of <- solely in
terms of monads. It is certainly appropriate there, but it is also
appropriate for lists when thought of purely as a bulk data type, and I
think it's appropriate here also.

Simon's syntax also provides a viable alternative to @ patterns

  f x @ (Just 3) y = e

  f x y | Just 3 <- x = e

though it is slightly less convenient in certain contrived examples (but
very much less ad hoc).

John.




Reply via email to