Skip to content

Instantly share code, notes, and snippets.

@cemerick
Last active November 26, 2018 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cemerick/e2a1edfde67280d16a19755f89db7ff7 to your computer and use it in GitHub Desktop.
Save cemerick/e2a1edfde67280d16a19755f89db7ff7 to your computer and use it in GitHub Desktop.
-- mostly ripped off from https://teh.id.au/posts/2017/02/13/interactive-print/index.html
:{
:def pp (\_ -> return
$ unlines ["import qualified Text.Show.Pretty as SP",
"import qualified Language.Haskell.HsColour as HSC",
"import Language.Haskell.HsColour.Colourise (defaultColourPrefs)",
"_colorPrint = putStrLn . HSC.hscolour HSC.TTY defaultColourPrefs False False \"\" False . SP.ppShow",
":set -interactive-print _colorPrint"])
:}
:def npp \_ -> return (":set -interactive-print System.IO.print")
:pp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment