incorrect implementation of :show bindings?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

incorrect implementation of :show bindings?

Peter Hercek-2
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
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: incorrect implementation of :show bindings?

Pepe Iborra-3
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 <[hidden email]> 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
> [hidden email]
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Reply | Threaded
Open this post in threaded view
|

Re: incorrect implementation of :show bindings?

Peter Hercek-2
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 <[hidden email]> 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
>> [hidden email]
>> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>>
>>    

_______________________________________________
Glasgow-haskell-users mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users