[GHC] #11641: Allow wildcards for parameters functionally determined (also type synonyms)

#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

#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

#11641: Allow wildcards for parameters functionally determined (also type synonyms) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: new Priority: lowest | Milestone: Component: Compiler (Type | Version: 8.1 checker) | Keywords: Resolution: | PartialTypeSignatures | FunctionalDependencies Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * keywords: PartialTypeSignatures => PartialTypeSignatures FunctionalDependencies * cc: thomasw (added) * component: Compiler => Compiler (Type checker) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11641#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC