1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

Merge pull request #199 from github/simpler-ghci-configuration

Simplify ghci config using :def!
This commit is contained in:
Rob Rix 2019-07-24 06:54:35 -05:00 committed by GitHub
commit daa018d0a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

16
.ghci
View File

@ -2,16 +2,9 @@
:set -package pretty-show -package hscolour
-- See docs/💡ProTip!.md
:undef pretty
:def pretty \ _ -> return ":set -interactive-print Semantic.Util.Pretty.prettyShow"
-- See docs/💡ProTip!.md
:undef no-pretty
:def no-pretty \_ -> return ":set -interactive-print System.IO.print"
-- See docs/💡ProTip!.md
:undef r
:def r \_ -> return (unlines [":reload", ":pretty"])
:def! pretty \ _ -> return ":set -interactive-print Semantic.Util.Pretty.prettyShow"
:def! no-pretty \_ -> return ":set -interactive-print System.IO.print"
:def! r \_ -> return (unlines [":reload", ":pretty"])
-- See docs/💡ProTip!.md for documentation & examples.
:{
@ -29,8 +22,7 @@ assignmentExample lang = case lang of
_ -> mk "" ""
where mk fileExtension parser = putStrLn ("example: fmap (() <$) . runTask . parse " ++ parser ++ "Parser =<< Semantic.Util.blob \"example." ++ fileExtension ++ "\"") >> return ("import Parsing.Parser\nimport Semantic.Task\nimport Semantic.Util")
:}
:undef assignment
:def assignment assignmentExample
:def! assignment assignmentExample
-- Enable breaking on errors for code written in the repl.
:seti -fbreak-on-error