incorrect implementation of :show bindings?

Hi, Bindings displayed with ":show bindings" do not correspond to what can be observed by printing values explicitly for example using ":force". Is it supposed to work like that? If yes, why? Notice the value and type reported for variable "test" after it has been redefined in the example at this post end. Thanks, Peter. status:0 peter@dwarf [703] /tmp % ghci GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> let test = 0 Prelude> :show bindings test :: Integer = _ Prelude> :force test test = 0 Prelude> let test = "zero" Prelude> :show bindings test :: Integer = 0 Prelude> :force test test = ['z','e','r','o'] Prelude> :quit Leaving GHCi. status:0 peter@dwarf [704] /tmp %

Hi Peter,
It looks like a bug to me too.
I tested it and 6.6 displays the correct behaviour, while 6.8.1 shows
the bug. You should open a ticket if you haven't done so yet.
Cheers,
pepe
On Thu, Jan 22, 2009 at 11:57 AM, Peter Hercek
Hi,
Bindings displayed with ":show bindings" do not correspond to what can be observed by printing values explicitly for example using ":force". Is it supposed to work like that? If yes, why?
Notice the value and type reported for variable "test" after it has been redefined in the example at this post end.
Thanks, Peter.
status:0 peter@dwarf [703] /tmp % ghci GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> let test = 0 Prelude> :show bindings test :: Integer = _ Prelude> :force test test = 0 Prelude> let test = "zero" Prelude> :show bindings test :: Integer = 0 Prelude> :force test test = ['z','e','r','o'] Prelude> :quit Leaving GHCi. status:0 peter@dwarf [704] /tmp %
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Hi Pepe, Thanks for the confirmation. I added the ticket: http://hackage.haskell.org/trac/ghc/ticket/2976 Peter. Pepe Iborra wrote:
Hi Peter,
It looks like a bug to me too. I tested it and 6.6 displays the correct behaviour, while 6.8.1 shows the bug. You should open a ticket if you haven't done so yet.
Cheers, pepe
On Thu, Jan 22, 2009 at 11:57 AM, Peter Hercek
wrote: Hi,
Bindings displayed with ":show bindings" do not correspond to what can be observed by printing values explicitly for example using ":force". Is it supposed to work like that? If yes, why?
Notice the value and type reported for variable "test" after it has been redefined in the example at this post end.
Thanks, Peter.
status:0 peter@dwarf [703] /tmp % ghci GHCi, version 6.10.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> let test = 0 Prelude> :show bindings test :: Integer = _ Prelude> :force test test = 0 Prelude> let test = "zero" Prelude> :show bindings test :: Integer = 0 Prelude> :force test test = ['z','e','r','o'] Prelude> :quit Leaving GHCi. status:0 peter@dwarf [704] /tmp %
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
participants (2)
-
Pepe Iborra
-
Peter Hercek