[Haskell-cafe] ($) not as transparent as it seems

Luke Palmer lrpalmer at gmail.com
Thu Feb 3 23:03:36 CET 2011


This is probably a result of strictness analysis.  error is
technically strict, so it is reasonable to optimize to:

    let e = error "foo" in e `seq` error e

On Thu, Feb 3, 2011 at 1:44 PM, Steffen Schuldenzucker
<sschuldenzucker at uni-bonn.de> wrote:
>
> Dear cafe,
>
> does anyone have an explanation for this?:
>
>>>> error (error "foo")
> *** Exception: foo
>
>>>> error $ error "foo"
> *** Exception: *** Exception: foo
>
> -- Steffen
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



More information about the Haskell-Cafe mailing list