No fixity declaration for deepseq
chessai .
chessai1996 at gmail.com
Mon Apr 13 22:09:14 UTC 2020
This seems unintended. Maybe others are wise to the contrary? Perhaps a
patch should be made.
Thanks
On Mon, Apr 13, 2020, 1:57 PM Christiaan Baaij <christiaan.baaij at gmail.com>
wrote:
> Hello list,
>
> Is the following behavior intended? or an oversight?
>
> Prelude Control.DeepSeq> tail ((undefined :: ()) `seq` 1 : [])
> *** Exception: Prelude.undefined
> CallStack (from HasCallStack):
> error, called at libraries/base/GHC/Err.hs:80:14 in base:GHC.Err
> undefined, called at <interactive>:5:8 in interactive:Ghci2
> Prelude Control.DeepSeq> tail ((undefined :: ()) `deepseq` 1 : [])
> []
>
> If you're wondering what's happening, there is a (builtin) fixity
> declaration for 'seq':
> infixr `seq` 0
>
> But there isn't one for `deepseq`.
>
> So
>
> undefined `seq` 1 : []
>
> is parsed as
>
> undefined `seq` (1 : [])
>
> while
>
> undefined `deepseq` 1 : []
>
> is parsed as
>
> (undefined `deepseq` 1) : []
>
> In a real-life use-case, changing `seq` to `deepseq` actually resulted in
> a (very unanticipated) space-leak for me. So again, is the lack of fixity
> declaration for deepseq intentional? or an accidental omission?
>
> Best regards,
>
> Christiaan
>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20200413/e404c15e/attachment.html>
More information about the Libraries
mailing list