[GHC] #15762: ghci command: report function's inferred visible type applications

#15762: ghci command: report function's inferred visible type applications -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: GHCi | Version: 8.6.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: #15610 #15613 Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Example inspired by #40. ghci already has a [https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html #ghci-cmd-:type-at :type-at] command for reporting a type in a range {{{
:type-at X.hs 6 6 6 7 f Int -> Int }}}
A similar thing (for integrating into IDEs) is doing the same for visible type applications. An innocent expression like `x y` has a lot going on under the surface {{{#!hs {-# Language RankNTypes #-} {-# Language PolyKinds #-} {-# Language KindSignatures #-} import Data.Kind f :: forall res . (forall k (f :: k -> Type) (a :: k). f a -> res) -> (forall (f :: Type -> Type) . f res) -> res f x y = x y }}} How hard would it be to expand that to `(x @Type @f @res) (y @f)` or (x @Type @Any @res) (y @Any) {{{#!hs f :: forall res (f :: Type -> Type) . (forall k (f :: k -> Type) (a :: k). f a -> res) -> (forall (f :: Type -> Type) . f res) -> res f x y = (x @Type @f @res) (y @f) }}} ---- Other ghci ideas: #15610, #15613 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15762 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15762: ghci command: report function's inferred visible type applications -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #15610 #15613 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by Iceland_jack: Old description:
Example inspired by #40.
ghci already has a [https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html #ghci-cmd-:type-at :type-at] command for reporting a type in a range
{{{
:type-at X.hs 6 6 6 7 f Int -> Int }}}
A similar thing (for integrating into IDEs) is doing the same for visible type applications. An innocent expression like `x y` has a lot going on under the surface
{{{#!hs {-# Language RankNTypes #-} {-# Language PolyKinds #-} {-# Language KindSignatures #-}
import Data.Kind
f :: forall res . (forall k (f :: k -> Type) (a :: k). f a -> res) -> (forall (f :: Type -> Type) . f res) -> res f x y = x y }}}
How hard would it be to expand that to `(x @Type @f @res) (y @f)` or (x @Type @Any @res) (y @Any)
{{{#!hs f :: forall res (f :: Type -> Type) . (forall k (f :: k -> Type) (a :: k). f a -> res) -> (forall (f :: Type -> Type) . f res) -> res f x y = (x @Type @f @res) (y @f) }}}
----
Other ghci ideas: #15610, #15613
New description: Example inspired by #40. ghci already has a [https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html #ghci-cmd-:type-at :type-at] command for reporting a type in a range {{{
:type-at X.hs 6 6 6 7 f Int -> Int }}}
A similar thing (for integrating into IDEs) is doing the same for visible type applications. An innocent expression like `x y` has a lot going on under the surface {{{#!hs {-# Language RankNTypes #-} {-# Language PolyKinds #-} {-# Language KindSignatures #-} import Data.Kind f :: forall res . (forall k (f :: k -> Type) (a :: k). f a -> res) -> (forall (f :: Type -> Type) . f res) -> res f x y = x y }}} How hard would it be to expand that to `(x @Type @f @res) (y @f)` (or `(x @Type @Any @res) (y @Any)`) {{{#!hs f :: forall res (f :: Type -> Type) . (forall k (f :: k -> Type) (a :: k). f a -> res) -> (forall (f :: Type -> Type) . f res) -> res f x y = (x @Type @f @res) (y @f) }}} ---- Other ghci ideas: #15610, #15613 -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15762#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15762: ghci command: report function's inferred visible type applications -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #15610 #15613 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): Would be invaluable for Ryan's [https://github.com/ekmett/eq/blob/9a8b1f61ad44a65c8f2ea5b900dc975658445c65/s... eq] :P {{{#!hs symm :: forall (a::k) (b::j). (:==) @k @j a b -> (:==) @j @k b a symm ab = unpush @j @k @(:==) @b @a $ unsymm @k @j @(Push (:==)) @a @b $ hsubst @k @j @a @b @(Symm (Push (:==)) a) ab $ Symm @k @k @(Push (:==)) @a @a $ Push @k @k @(:==) @a @a $ refl @k @a }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15762#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15762: ghci command: report function's inferred visible type applications -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.6.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #13480 #15610 | Differential Rev(s): #15613 | Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * related: #15610 #15613 => #13480 #15610 #15613 Comment: Is this a duplicate of #13480? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15762#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC