[GHC] #11641: Allow wildcards for parameters functionally determined (also type synonyms)
GHC
ghc-devs at haskell.org
Thu Feb 25 01:27:18 UTC 2016
#11641: Allow wildcards for parameters functionally determined (also type synonyms)
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner:
Type: feature | Status: new
request |
Priority: lowest | Milestone:
Component: Compiler | Version: 8.1
Keywords: | Operating System: Unknown/Multiple
PartialTypeSignatures |
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
{{{#!hs
class F a b | a -> b where
foo :: a
-- ...
myFoo :: F a b => a
myFoo = foo
}}}
Since ''b'' is not used and fully determined by ''a'' could the
restriction on wildcards in constraints be lifted?
{{{#!hs
myFoo :: F a _ => a
myFoo = foo
}}}
and eventually hiding it behind a type synonym:
{{{#!hs
type F' a = F a _
myFoo' :: F' a => a
myFoo' = foo
}}}
I raised this issue at ICFP 2014, I haven't looked into whether
dominique's response to [https://haskell-
phabricator.global.ssl.fastly.net/D168#4818 my comment] applies.
----
I could achieve similar things with a type family but that work as I'd
intended.
----
Or CPP :)
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11641>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list