Visible type application doesn't work for functions with inferred types
GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /home/feuerbach/.ghci
Prelude> :set -XTypeApplications -fprint-explicit-kinds -fprint-explicit-foralls
Prelude> :t id
id :: forall {a}. a -> a
Prelude> :t id @Int
id @Int :: Int -> Int
Prelude> let foo :: a -> a; foo = id
Prelude> :t foo
foo :: forall {a}. a -> a
Prelude> :t foo @Int
foo @Int :: Int -> Int
Prelude> let bar = id
Prelude> :t bar
bar :: forall {a}. a -> a
Prelude> :t bar @Int
<interactive>:1:1: error:
• Cannot apply expression of type ‘a0 -> a0’
to a visible type argument ‘Int’
• In the expression: bar @Int
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |