I don't use rank-2 types that often and when I do I'm aware of the
restriction on ($) and similar hofs. I tend to use ($) only when the
right-hand side gets very messy; a multiple-line do or similar. For
example:

blah = fromMaybe $ do
  x <- blah1
  y <- blah2
  guard (x == f y)
  g x

The closing parenthesis would make things a little messy, so ($) is nice.

-David House, [EMAIL PROTECTED]

For this situation, I go ahead and name the subcomputation with a
where clause or a do-let binding. Usually, naming sub terms can't
hurt.

Other than "look at Darcs or GHC", has there been any efforts for
(very general, libertarian even) coding guidelines? "Suggestions &
tips" might be a better word.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to