[GHC] #11641: Allow wildcards for parameters functionally determined (also type synonyms)
GHC
ghc-devs at haskell.org
Thu Feb 25 01:27:42 UTC 2016
#11641: Allow wildcards for parameters functionally determined (also type synonyms)
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner:
Type: feature request | Status: new
Priority: lowest | Milestone:
Component: Compiler | Version: 8.1
Resolution: | Keywords:
| PartialTypeSignatures
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Description changed by Iceland_jack:
@@ -33,2 +33,1 @@
- I could achieve similar things with a type family but that work as I'd
- intended.
+ I could achieve similar things with a type family but not quite.
New description:
{{{#!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 not quite.
----
Or CPP :)
--
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11641#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list