Opened 4 years ago

Last modified 4 years ago

#11641 new feature request

Allow wildcards for parameters functionally determined (also type synonyms)

Reported by: Iceland_jack Owned by:
Priority: lowest Milestone:
Component: Compiler (Type checker) Version: 8.1
Keywords: PartialTypeSignatures FunctionalDependencies Cc: thomasw
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 (last modified by Iceland_jack)

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?

myFoo :: F a _ => a
myFoo = foo

and eventually hiding it behind a type synonym:

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 my comment applies.

I could achieve similar things with a type family but not quite.

Or CPP :)

Change History (2)

comment:1 Changed 4 years ago by Iceland_jack

Description: modified (diff)

comment:2 Changed 4 years ago by thomie

Cc: thomasw added
Component: CompilerCompiler (Type checker)
Keywords: FunctionalDependencies added
Note: See TracTickets for help on using tickets.