[GHC] #12447: Pretty-printing of equality `~` without parentheses
GHC
ghc-devs at haskell.org
Fri Jul 29 01:11:57 UTC 2016
#12447: Pretty-printing of equality `~` without parentheses
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Iceland_jack):
Same with
{{{#!hs
{-# Language KindSignatures, TypeOperators #-}
import Data.Kind
import Data.Type.Equality
class Foo (p :: Constraint)
instance Foo (a ~ b)
instance Foo (a ~~ b)
}}}
{{{
$ ghci -ignore-dot-ghci /tmp/tOrO.hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( /tmp/tOrO.hs, interpreted )
Ok, modules loaded: Main.
*Main> :i Foo
class Foo (p :: Constraint) -- Defined at /tmp/tOrO.hs:6:1
instance [safe] Foo a ~ b -- Defined at /tmp/tOrO.hs:8:10
}}}
{{{
*Main> :set -fprint-equality-relations
*Main> :i Foo
class Foo (p :: Constraint) -- Defined at /tmp/tOrO.hs:6:1
instance [safe] Foo (a :: *) ~~ (b :: *)
-- Defined at /tmp/tOrO.hs:8:10
}}}
Should be `
{{{
*Main> :i Foo
class Foo (p :: Constraint) -- Defined at /tmp/tOrO.hs:6:1
instance [safe] Foo (a ~ b) -- Defined at /tmp/tOrO.hs:8:10
*Main> :set -fprint-equality-relations
*Main> :i Foo
class Foo (p :: Constraint) -- Defined at /tmp/tOrO.hs:6:1
instance [safe] Foo ((a :: *) ~~ (b :: *))
-- Defined at /tmp/tOrO.hs:8:10
}}}
----
Is this the same as #12005, two instances are defined:
{{{#!hs
instance Foo (a ~ b)
instance Foo (a ~~ b)
}}}
but only one displayed in `:info`: is the first subsumed by the latter?
There is some funny business going on in the
[https://hackage.haskell.org/package/base-4.9.0.0/docs/Data-Type-
Equality.html#t:-126--126- definition of ‘~~’] so I don't know if those
are separate instances. For example what is the difference between these
two instances `↓`?
{{{#!hs
instance Foo (a ~ b)
instance Foo ((a::Type) ~~ (b::Type))
}}}
Again, only the latter is displayed:
{{{#!hs
*Main> :i Foo
class Foo (p :: Constraint) -- Defined at /tmp/tOrO.hs:6:1
instance [safe] Foo a ~ b -- Defined at /tmp/tOrO.hs:8:10
*Main> :set -fprint-equality-relations
*Main> :i Foo
class Foo (p :: Constraint) -- Defined at /tmp/tOrO.hs:6:1
instance [safe] Foo (a :: *) ~~ (b :: *)
-- Defined at /tmp/tOrO.hs:8:10
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12447#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list