[GHC] #12447: Pretty-printing of equality `~` without parentheses
GHC
ghc-devs at haskell.org
Thu Jul 28 20:17:41 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
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
Based off on
[https://github.com/ekmett/constraints/blob/master/src/Data/Constraint/Deferrable.hs
Data.Constraint.Deferrable]
{{{#!hs
{-# Language RankNTypes, ConstraintKinds #-}
import Data.Typeable
class Deferrable p where
deferEither :: proxy p -> (p => r) -> Either String r
instance (Typeable a, Typeable b) => Deferrable (a ~ b) where
deferEither = undefined
}}}
`PolyKinds` aren't enabled so `deferEither @(_ ~ _)` is not enough to
select the `Deferrable (a ~ b)` instance, but it is displayed without
parentheses
{{{
$ ghci -XTypeApplications -ignore-dot-ghci tyiS.hs
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
[1 of 1] Compiling Main ( tyiS.hs, interpreted )
Ok, modules loaded: Main.
*Main> :t deferEither @(_ ~ _)
deferEither @(_ ~ _)
:: Deferrable t ~ t1 =>
proxy t ~ t1 -> (t ~ t1 => r) -> Either String r
}}}
Instead of a preferable
{{{#!hs
deferEither @(_ ~ _) :: Deferrable (t ~ t1) => proxy (t ~ t1) -> (t ~ t1
=> r) -> Either String r
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12447>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list