Skip to content

Unify named wildcards in different type applications

(motivating post)

I would like to use type application to specialize

Sub :: forall (a :: Constraint) (b :: Constraint). (a => Dict b) -> a :- b
Sub @(Ord _a) @(Eq _a) :: forall {a}. (Ord a => Dict (Eq a)) -> Ord a :- Eq a

and

map :: forall a b. (a -> b) -> [a] -> [b]
map @_a @_a :: forall {a}. (a -> a) -> [a] -> [a]

Is there a fundamental reason why named wildcards are not allowed to unify between type applications within the same expression? Documentation:

These are called named wildcards. All occurrences of the same named wildcard within one type signature will unify to the same type.

I don't know if this is intended.

Trac metadata
Trac field Value
Version 8.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information