No fixity declaration for deepseq

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

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
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@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
participants (2)
-
chessai .
-
Christiaan Baaij