[GHC] #12524: RFC: Allow prefixing result evaluated at GHCi prompt
GHC
ghc-devs at haskell.org
Tue Aug 23 01:40:42 UTC 2016
#12524: RFC: Allow prefixing result evaluated at GHCi prompt
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner:
Type: feature | Status: new
request |
Priority: lowest | Milestone:
Component: GHCi | 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:
-------------------------------------+-------------------------------------
Similar to `prompt`, `prompt-cont` (previously `prompt2`): allowing users
to supply a prefix to evaluation results with `result` has two use cases I
can think of
{{{
:set prompt " ghci> "
:set prompt-cont " ghci| "
:set result " "
}}}
the desired outcome would be `↓` as indented code for IRC, also reddit
code format:
{{{
ghci> 1 + 2 + 3
6
ghci> reverse "hello"
"olleh"
}}}
----
The other case came from
[https://twitter.com/rightfold/status/767301255140179968 this tweet]
{{{
:set prompt ""
:set result "-- "
}}}
{{{
1 + 2 + 3
-- 6
reverse "hello"
-- "olleh"
}}}
This can be copied/pasted back to a separate GHCi session where the result
is ignored.
----
I haven't seen this feature in any other repl, I'm not sure if this would
see much use.
This wouldn't work with IO actions without some magic.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12524>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list