Re: [GHC] #6022: GHC infers over-general types

#6022: GHC infers over-general types -------------------------------------+------------------------------------- Reporter: simonpj | Owner: simonpj Type: bug | Status: new Priority: normal | Milestone: 7.10.1 Component: Compiler | Version: 7.4.1 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by thomie): GHC should reject `f` ''without'' type signature, because it also rejects `f` ''with'' type signature, unless `FlexibleContexts` is enabled. {{{ Prelude> let f x = x + head -- GHC should complain here Prelude> :t f f :: Num ([a] -> a) => ([a] -> a) -> [a] -> a Prelude> let f :: Num ([a] -> a) => ([a] -> a) -> [a] -> a; f x = x + head <interactive>:4:10: Non type-variable argument in the constraint: Num ([a] -> a) (Use FlexibleContexts to permit this) In the type signature for âfâ: f :: Num ([a] -> a) => ([a] -> a) -> [a] -> a Prelude> :set -XFlexibleContexts Prelude> let f :: Num ([a] -> a) => ([a] -> a) -> [a] -> a; f x = x + head Prelude> }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/6022#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC