On Fri, Mar 08, 2013 at 08:53:15PM -0800, Edward Z. Yang wrote:
Are these equivalent? If not, under what circumstances are they not
equivalent? When should you use each?
evaluate a return b
a `seq` return b
return (a `seq` b)
Furthermore, consider:
[...]
- Does the
On 13-03-08 11:53 PM, Edward Z. Yang wrote:
Are these equivalent? If not, under what circumstances are they not
equivalent? When should you use each?
evaluate a return b
a `seq` return b
return (a `seq` b)
Let a = div 0 0
(or whatever pure but problematic expression you like)
On Fri, Mar 08, 2013 at 08:53:15PM -0800, Edward Z. Yang wrote:
Are these equivalent? If not, under what circumstances are they not
equivalent? When should you use each?
evaluate a return b
[...]
- Use 'evaluate' when you mean to say, Evaluate this thunk to HNF
before doing
Excerpts from Tom Ellis's message of Sat Mar 09 00:34:41 -0800 2013:
I've never looked at evaluate before but I've just found it's haddock and
given it some thought.
http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Exception-Base.html#v:evaluate
Since it is
Are these equivalent? If not, under what circumstances are they not
equivalent? When should you use each?
evaluate a return b
a `seq` return b
return (a `seq` b)
Furthermore, consider:
- Does the answer change when a = b? In such a case, is 'return $! b'
permissible?
-