
Hello, If I use :browse a module with GHC 6.12, it sometimes displays garbage. Here is an example: Prelude> :browse Data.IP data AddrRange a = iproute-0.2.0:Data.IP.Range.AddrRange {addr :: a, mask :: a, mlen :: Int} (snip) data AddrRange a = iproute-0.2.0:Data.IP.Range.AddrRange {..., mask :: a, ...} data AddrRange a = iproute-0.2.0:Data.IP.Range.AddrRange {..., mlen :: Int} "..." is the garbage. Due to this, I cannot parse the output of :browse. This is not displayed with GHC 6.10. Q1) What is the intention of "..."? Q2) How to prevent it so that I can obtain output which I can parse? --Kazu

If I use :browse a module with GHC 6.12, it sometimes displays garbage. Here is an example:
Prelude> :browse Data.IP data AddrRange a = iproute-0.2.0:Data.IP.Range.AddrRange {addr :: a, mask :: a, mlen :: Int} (snip) data AddrRange a = iproute-0.2.0:Data.IP.Range.AddrRange {..., mask :: a, ...} data AddrRange a = iproute-0.2.0:Data.IP.Range.AddrRange {..., mlen :: Int}
"..." is the garbage. Due to this, I cannot parse the output of :browse. This is not displayed with GHC 6.10.
Q1) What is the intention of "..."?
I believe it's related to the module export list.
module Test (y) where data R = R { x :: Char, y :: Int, z :: Float }
*Test> :browse data Test.R = Test.R {..., y :: Int, ...} Q2) How to prevent it so that I can obtain output which I can parse?
Export all the labels, perhaps? Regards, Sean

Q1) What is the intention of "..."?
I believe it's related to the module export list.
module Test (y) where data R = R { x :: Char, y :: Int, z :: Float }
*Test> :browse data Test.R = Test.R {..., y :: Int, ...}
Thank you for your reply. The target module exposes like this: module Test (R(..)) where So, this is not the case which you referred to. --Kazu

Am Samstag 24 April 2010 07:07:15 schrieb Kazu Yamamoto:
Hello,
If I use :browse a module with GHC 6.12, it sometimes displays garbage. Here is an example:
Prelude> :browse Data.IP data AddrRange a = iproute-0.2.0:Data.IP.Range.AddrRange {addr :: a, mask :: a, mlen :: Int} (snip) data AddrRange a = iproute-0.2.0:Data.IP.Range.AddrRange {..., mask :: a, ...} data AddrRange a = iproute-0.2.0:Data.IP.Range.AddrRange {..., mlen :: Int}
"..." is the garbage. Due to this, I cannot parse the output of
:browse. This is not displayed with GHC 6.10.
Q1) What is the intention of "..."? Q2) How to prevent it so that I can obtain output which I can parse?
Perhaps *Test> :browse! Test -- defined locally data R = R {x :: Char, y :: Int, z :: Float} R :: Char -> Int -> Float -> R x :: R -> Char y :: R -> Int z :: R -> Float is the answer?
--Kazu

Hello,
*Test> :browse! Test -- defined locally data R = R {x :: Char, y :: Int, z :: Float} R :: Char -> Int -> Float -> R x :: R -> Char y :: R -> Int z :: R -> Float
is the answer?
Thank you for your reply. Unfortunately, the answer is NO. ":browse!" cannot be used for my program. I want to use ":browse". Again, my question is: suppose the following code is given: module Test (R(..)) where data R = R { x :: Char, y :: Int, z :: Float } and ":browse" of GHC 6.12 displays: data R = R {x :: Char, y :: Int, z :: Float} data R = R {x :: Char, ...} data R = R {..., y :: Int, ...} data R = R {..., z :: Float} which cannot be parsed. But ":browse" of GHC 6.10 displays: data R = R {x :: Char, y :: Int, z :: Float} which can be parsed. Is this intentional change or a bug of GHC 6.12? --Kazu

| Again, my question is: suppose the following code is given: | | module Test (R(..)) where | data R = R { x :: Char, y :: Int, z :: Float } | | and ":browse" of GHC 6.12 displays: | | data R = R {x :: Char, y :: Int, z :: Float} | data R = R {x :: Char, ...} | data R = R {..., y :: Int, ...} | data R = R {..., z :: Float} | | which cannot be parsed. That's a bug, plain and simple. I know why it happens, too, though I will not bore you with the details. I'll make a Trac ticket. Simon

| data R = R {x :: Char, y :: Int, z :: Float} | data R = R {x :: Char, ...} | data R = R {..., y :: Int, ...} | data R = R {..., z :: Float} | | which cannot be parsed.
That's a bug, plain and simple. I know why it happens, too, though I will not bore you with the details. I'll make a Trac ticket.
Thanks. Another related question: ":browse Prelude" of GHC 6.12 displays: data Integer = integer-gmp:GHC.Integer.Type.S# GHC.Prim.Int# | integer-gmp:GHC.Integer.Type.J# GHC.Prim.Int# GHC.Prim.ByteArray# That of GHC 6.10 displays: data Integer = GHC.Integer.Internals.S# GHC.Prim.Int# | GHC.Integer.Internals.J# GHC.Prim.Int# GHC.Prim.ByteArray# Is the additional prefix of "integer-gmp:" intentional or a bug? --Kazu
participants (4)
-
Daniel Fischer
-
Kazu Yamamoto
-
Sean Leather
-
Simon Peyton-Jones