2017-10-13 19:42:08 +03:00
|
|
|
-- Load the pretty-show & hscolour packages for use with :pretty.
|
|
|
|
:set -package pretty-show -package hscolour
|
|
|
|
|
2017-10-13 18:23:55 +03:00
|
|
|
-- See docs/💡ProTip!.md
|
2017-10-13 17:20:36 +03:00
|
|
|
:undef pretty
|
2017-10-13 19:47:21 +03:00
|
|
|
:def pretty \ _ -> return (unlines ["let colour = putStrLn . Language.Haskell.HsColour.hscolour Language.Haskell.HsColour.TTY Language.Haskell.HsColour.Colourise.defaultColourPrefs Prelude.False Prelude.False \"\" Prelude.False . Text.Show.Pretty.ppShow", ":set -interactive-print colour"])
|
2017-10-13 17:20:36 +03:00
|
|
|
|
2017-10-13 18:23:55 +03:00
|
|
|
-- See docs/💡ProTip!.md
|
2017-10-13 17:20:36 +03:00
|
|
|
:undef no-pretty
|
|
|
|
:def no-pretty \_ -> return ":set -interactive-print System.IO.print"
|
2017-10-13 17:20:48 +03:00
|
|
|
|
2017-10-13 18:23:55 +03:00
|
|
|
-- See docs/💡ProTip!.md
|
2017-10-13 19:47:46 +03:00
|
|
|
:undef r
|
|
|
|
:def r \_ -> return (unlines [":reload", ":pretty"])
|
2017-10-13 17:21:08 +03:00
|
|
|
|
2017-10-13 18:23:55 +03:00
|
|
|
-- See docs/💡ProTip!.md for documentation & examples.
|
2017-10-13 17:55:15 +03:00
|
|
|
:{
|
|
|
|
assignmentExample lang = case lang of
|
|
|
|
"Python" -> mk "py" "python"
|
|
|
|
"Go" -> mk "go" "go"
|
|
|
|
"Ruby" -> mk "rb" "ruby"
|
|
|
|
"JavaScript" -> mk "js" "typescript"
|
|
|
|
"TypeScript" -> mk "ts" "typescript"
|
|
|
|
"Haskell" -> mk "hs" "haskell"
|
|
|
|
"Markdown" -> mk "md" "markdown"
|
|
|
|
"JSON" -> mk "json" "json"
|
|
|
|
_ -> mk "" ""
|
2017-11-27 21:24:45 +03:00
|
|
|
where mk fileExtension parser = putStrLn ("example: fmap (() <$) . runTask . parse " ++ parser ++ "Parser =<< Semantic.Util.file \"example." ++ fileExtension ++ "\"") >> return ("import Parsing.Parser\nimport Semantic.Task\nimport Semantic.Util")
|
2017-10-13 17:55:15 +03:00
|
|
|
:}
|
2017-10-13 18:24:13 +03:00
|
|
|
:undef assignment
|
2017-10-13 17:55:15 +03:00
|
|
|
:def assignment assignmentExample
|
|
|
|
|
2017-10-13 18:23:55 +03:00
|
|
|
-- Enable breaking on errors for code written in the repl.
|
2017-10-13 17:21:08 +03:00
|
|
|
:seti -fbreak-on-error
|
2017-10-13 17:21:29 +03:00
|
|
|
|
2017-10-13 18:23:55 +03:00
|
|
|
-- Continue loading after warnings when in the repl.
|
2017-10-13 17:21:29 +03:00
|
|
|
:set -Wwarn
|
2017-10-13 17:21:39 +03:00
|
|
|
|
2017-10-13 18:23:55 +03:00
|
|
|
-- Use a cyan lambda as the prompt.
|
2017-10-13 18:41:52 +03:00
|
|
|
:set prompt "\ESC[1;36m\STXλ \ESC[m\STX"
|