2 | import public Control.ANSI.CSI
3 | import public Control.ANSI.SGR
8 | record DecoratedString where
9 | constructor MkDString
14 | Show DecoratedString where
15 | show dstr = escapeSGR dstr.sgr ++ dstr.str ++ escapeSGR [Reset]
18 | colored : Color -> String -> DecoratedString
19 | colored c = MkDString [SetForeground c]
22 | background : Color -> String -> DecoratedString
23 | background c = MkDString [SetBackground c]
26 | bolden : String -> DecoratedString
27 | bolden = MkDString [SetStyle Bold]
30 | italicize : String -> DecoratedString
31 | italicize = MkDString [SetStyle Italic]
34 | underline : String -> DecoratedString
35 | underline = MkDString [SetStyle SingleUnderline]