From e9dc41701fc5534cb005565a69219ef2a37e4a6d Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 18 Jul 2019 12:41:36 -0400 Subject: [PATCH] Simplify ghci config using :def!. --- .ghci | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.ghci b/.ghci index 639be4528..c810e063e 100644 --- a/.ghci +++ b/.ghci @@ -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