[GHC] #10814: Eliminate some ambiguity for IsString [a]
GHC
ghc-devs at haskell.org
Mon Aug 31 04:08:05 UTC 2015
#10814: Eliminate some ambiguity for IsString [a]
-------------------------------------+-------------------------------------
Reporter: dolio | Owner: ekmett
Type: task | Status: new
Priority: normal | Milestone: 7.12.1
Component: Core | Version: 7.10.2
Libraries |
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Revisions: |
-------------------------------------+-------------------------------------
The libraries list resolved to make a modification to the `String`
instance for `IsString` to resolve certain ambiguous cases. One example
is:
{{{#!hs
"hello" ++ " world"
}}}
This case can be resolved by making the instance:
{{{#!hs
instance (a ~ Char) => IsString [a] where ...
}}}
rather than:
{{{#!hs
instance IsString [Char] where ...
}}}
as the former matches only based on the head being `[a]`, and subsequently
determines `a ~ Char`, rather than only matching when other factors cause
the head to be fully resolved to `[Char]`.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10814>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list