Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Colorizing ghci output
- import Text.Show.Pretty (ppShow)
- import qualified Language.Haskell.HsColour as HSC
- import qualified Language.Haskell.HsColour.Colourise as HSC
- :{
- let myColourPrefs = HSC.defaultColourPrefs { HSC.conop = [HSC.Foreground HSC.Yellow]
- , HSC.conid = [HSC.Foreground HSC.Yellow, HSC.Bold]
- , HSC.string = [HSC.Foreground $ HSC.Rgb 29 193 57]
- , HSC.char = [HSC.Foreground HSC.Cyan]
- , HSC.number = [HSC.Foreground $ HSC.Rgb 202 170 236]
- , HSC.keyglyph = [HSC.Foreground HSC.Yellow]
- }
- :}
- :{
- ghciColorPrint :: Show a => a -> IO ()
- ghciColorPrint = putStrLn . HSC.hscolour HSC.TTY myColourPrefs False False "" False . ppShow
- :}
- :set -interactive-print=ghciColorPrint
- -- green bold lambdas and multiline mode
- :set prompt "\ESC[94m\STX \ESC[m\STX"
- -- :set prompt "\ESC[1;32mλ: \ESC[m"
- :set prompt2 "\ESC[1;32mλ| \ESC[m"
- -- :set +m
- :def package \ m -> return $ ":! ghc-pkg --simple-output find-module " ++ m
- :def no-pretty \_ -> return (":set -interactive-print=System.IO.print")
- :def rr \_ -> return ":script ~/.ghc/ghci.conf"
- -- print the logo
- :module Text.Heredoc
- :set -XQuasiQuotes
- :{
- putStrLn [str| \ \\ \
- | \ \\ \
- | \ \\ \ _____________
- | \ \\ \\ \
- | \ \\ \\____________\
- | \ \\ \ _____________
- | / // \\ \
- | / // \\____________\
- | / // /\ \
- | / // / \ \
- | / // / \ \
- | /____//____/ \____\
- | _ _ _ _ _
- | | | | | | | | | |
- | | |__| | __ _ ___| | _____| | |
- | | __ |/ _` / __| |/ / _ \ | |
- | | | | | (_| \__ \ < __/ | |
- | |_| |_|\__,_|___/_|\_\___|_|_|
- |]
- :}
- :module - Text.Heredoc
- :set -XNoQuasiQuotes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement