[GHC] #13811: eta reduction in GHCi for an educational purpose

#13811: eta reduction in GHCi for an educational purpose -------------------------------------+------------------------------------- Reporter: vanto | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: GHCi | Version: 8.0.2 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: -------------------------------------+------------------------------------- Hello,\\ Is it possible to have in GHCi an eta reduction of an expression for an educational purpose?\\ We would have access by typing a command like this on the line {{{:eta reduction <expr>}}} with the following annotation {{{show the eta reduction of <expr>}}} in short {{{:er <expr>}}}.\\ example:\\ {{{ Prelude> length xs = foldl (\n _ -> n+1) 0 xs Prelude> :eta reduction length --or :er length length = foldl (\n _ -> n+1) 0 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13811 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13811: eta reduction in GHCi for an educational purpose -------------------------------------+------------------------------------- Reporter: vanto | Owner: (none) Type: feature request | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 8.0.2 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * resolution: => invalid Comment: My instinct is that this feature is beyond the scope of GHCi and is better incorporated into another tool (perhaps [https://github.com/HeinrichApfelmus/hyper-haskell HyperHaskell]?), but others may differ in opinion. Regardless of my opinion on the feature, the way to incorporate this user-facing change is to write a [https://github.com/ghc-proposals/ghc-proposals ghc-proposal]. I'll also note that this will be hard to implement, as GHC does not store the user-written definition of functions anywhere. Given that this belongs as a ghc-proposal instead of a Trac ticket, I will close. This ticket can be reopened when the proposal is accepted. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13811#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC