[GHC] #11398: Type application for operator sections

#11398: Type application for operator sections -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Unknown/Multiple TypeApplications | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- With `-fprint-explicit-foralls` {{{#!hs (+ 1) :: forall {a}. Num a => a -> a }}} This means we cannot apply it to a type: {{{#!hs (+ 1) @Int :: Int -> Int }}} Since sections are sugar `(+ 1)` could be given the type `forall a. Num a => a -> a` instead. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11398 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11398: Type application for operator sections -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.3 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): What's the typing rule you're proposing? It's awfully easy to find cases like this one where the behavior is straightforward, but coming up with a consistent rule is quite hard. Take `const`. What type should {{{(`const` undefined)}}} have? `forall a. a -> a`? `forall a b. a -> a`? What about {{{(undefined `const`)}}}? In the end, I think this is a no-go, for exactly the same reason that applied functions have inferred type parameters, not specified ones. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11398#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC