Ticket #2187 (closed bug: wontfix)
Top-level bindings are broken for polymorphic values
| Reported by: | yallop | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.10 branch |
| Component: | Compiler | Version: | 6.8.2 |
| Keywords: | Cc: | SamB | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
Top-level pattern bindings don't work for polymorphic values. Here's an example program:
[x] = [id]
ghci gives this the type
*Main> :t x x :: GHC.Prim.Any -> GHC.Prim.Any
which can't be used
*Main> x ()
<interactive>:1:2:
Couldn't match expected type `GHC.Prim.Any'
against inferred type `()'
In the first argument of `x', namely `()'
In the expression: x ()
In the definition of `it': it = x ()
Adding a type signature doesn't help:
x :: a -> a
[x] = [id]
Couldn't match expected type `forall a. a -> a'
against inferred type `a -> a'
Probable cause: `id' is applied to too few arguments
In the expression: id
In the expression: [id]
Change History
Note: See
TracTickets for help on using
tickets.
