[GHC] #16089: seq is not cooperating with :sprint in GHCi as expected
GHC
ghc-devs at haskell.org
Sun Dec 23 12:52:17 UTC 2018
#16089: seq is not cooperating with :sprint in GHCi as expected
-------------------------------------+-------------------------------------
Reporter: radrow | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: GHCi | Version: 8.6.3
Resolution: | Keywords: seq sprint
| strictness
Operating System: Linux | Architecture:
Type of failure: Incorrect result | Unknown/Multiple
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by osa1):
I can't reproduce this:
{{{
GHCi, version 8.6.3: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/omer/rcbackup/.ghci
λ:1> let x = [True, False]
λ:2> :sprint x
x = [True,False]
}}}
With 8.4.4:
{{{
GHCi, version 8.4.4: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/omer/rcbackup/.ghci
λ:1> let x = [True, False]
λ:2> :sprint x
x = [True,False]
}}}
With 8.2.2:
{{{
GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/omer/rcbackup/.ghci
λ:1> let x = [True, False]
λ:2> :sprint x
x = [True,False]
}}}
However if I use a list that is not completely static then I can see that
`:sprint` doesn't print the evaluated constructor:
{{{
GHCi, version 8.6.3: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/omer/rcbackup/.ghci
λ:1> let x = [1..]
λ:2> :sprint x
x = _
λ:3> x `seq` ()
()
λ:4> :sprint x
x = _
}}}
Even `:print` doesn't work as expected (I'd expect it to print something
like `x : y`):
{{{
λ:5> :print x
x = (_t1::(Num a, Enum a) => [a])
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16089#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list