[GHC] #12601: explicit foralls do not distinguish applicable types

#12601: explicit foralls do not distinguish applicable types -------------------------------------+------------------------------------- Reporter: dmwit | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- From [https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts... #visible-type-application the documentation for TypeApplications]: "When printing types with -fprint-explicit-foralls enabled, type variables not available for visible type application are printed in braces. Thus, if you write myLength = length without a type signature, myLength‘s inferred type will be forall {f} {a}. Foldable f => f a -> Int." This implies that type variables that ''are'' available for type application are ''not'' printed braces (though I admit that it doesn't say so outright!). With that in mind, I find the following behavior confusing: {{{
:set -XTypeApplications -fprint-explicit-foralls :t (1 :: Num a => a) (1 :: Num a => a) :: forall {a}. Num a => a (1 :: Num a => a) @Int 1 }}}
The :t query seems to indicate that the type variable is not available, but the evaluation query seems to indicate that it is. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12601 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12601: explicit foralls do not distinguish applicable types -------------------------------------+------------------------------------- Reporter: dmwit | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #13401 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * keywords: => TypeApplications * resolution: => fixed * related: => #13401 Comment: The users' guide documentation for `TypeApplications` has been improved since 8.0.1, and that section now properly mentions that if you wish to learn which types are available for visible type application, then you should use `:type +v`, not `:type`. See https://downloads.haskell.org/~ghc/8.4.2/docs/html/users_guide/glasgow_exts.... #visible-type-application (the result of #13401). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12601#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC