prints (empty) → 0.1.0.0
raw patch · 7 files changed
+169/−0 lines, 7 filesdep +basedep +hscolourdep +pretty-showsetup-changed
Dependencies added: base, hscolour, pretty-show, pretty-simple, text, transformers
Files
- LICENSE +30/−0
- README.md +15/−0
- Setup.hs +2/−0
- Text/Prints.hs +11/−0
- Text/Prints/Printers/Color.hs +37/−0
- Text/Prints/Printers/Simple.hs +40/−0
- prints.cabal +34/−0
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright Evan Turner (c)++∀ rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Evan Turner nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,15 @@+```+The Artist Formerly Known as++8888888b. 8888888b. 8888888 888b 888 88888888888 .d8888b. +888 Y88b 888 Y88b 888 8888b 888 888 d88P Y88b +888 888 888 888 888 88888b 888 888 Y88b. +888 d88P 888 d88P 888 888Y88b 888 888 "Y888b. +8888888P" 8888888P" 888 888 Y88b888 888 "Y88b. +888 888 T88b 888 888 Y88888 888 "888 +888 888 T88b 888 888 Y8888 888 Y88b d88P +888 888 T88b 8888888 888 Y888 888 "Y8888P" + + + +```
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ Text/Prints.hs view
@@ -0,0 +1,11 @@+module Text.Prints+ ( module Text.Prints.Printers.Color+ , module Text.Prints.Printers.Simple+ , prints+ ) where++import Text.Prints.Printers.Color+import Text.Prints.Printers.Simple++prints :: Show a => a -> IO ()+prints x = colorPrints x
+ Text/Prints/Printers/Color.hs view
@@ -0,0 +1,37 @@+{-# LANGUAGE OverloadedStrings #-}++module Text.Prints.Printers.Color+ ( colorPrints+ ) where++import qualified Language.Haskell.HsColour as HSC+import qualified Language.Haskell.HsColour.Colourise as HSC+import qualified Language.Haskell.HsColour.Output as HSC+import Text.Show.Pretty (ppShow)++colorPrints :: Show a => a -> IO ()+colorPrints = putStrLn . format . ppShow++prefs :: HSC.ColourPrefs+prefs = HSC.defaultColourPrefs+ { HSC.keyword = [HSC.Foreground HSC.Yellow]+ , HSC.comment = [HSC.Foreground HSC.Yellow]+ , HSC.varid = [HSC.Foreground HSC.Yellow]+ , HSC.varop = [HSC.Foreground HSC.Yellow]+ , HSC.selection = [HSC.Foreground HSC.Yellow]+ , HSC.variantselection = [HSC.Foreground HSC.Yellow]+ , HSC.definition = [HSC.Foreground HSC.Yellow]+ , HSC.conid = [HSC.Foreground (HSC.Rgb 95 95 255)]+ , HSC.conop = [HSC.Foreground HSC.Yellow]+ , HSC.string = [HSC.Foreground HSC.Green]+ , HSC.char = [HSC.Foreground HSC.Green]+ , HSC.number = [HSC.Foreground (HSC.Rgb 175 0 215)]+ , HSC.layout = [HSC.Foreground HSC.Red]+ , HSC.keyglyph = [HSC.Foreground HSC.Red]+ }++output :: HSC.Output+output = HSC.TTYg HSC.XTerm256Compatible++format :: String -> String+format = HSC.hscolour output prefs False False "" False
+ Text/Prints/Printers/Simple.hs view
@@ -0,0 +1,40 @@+module Text.Prints.Printers.Simple+ ( simplePrints+ ) where++import Control.Monad.IO.Class (MonadIO)+import Data.Text.Lazy.Builder (Builder)+import Text.Pretty.Simple+import Text.Pretty.Simple.Internal+import Text.Pretty.Simple.Internal.Color++simplePrints :: (MonadIO m, Show a) => a -> m ()+simplePrints = pPrintOpt OutputOptions+ { outputOptionsIndentAmount = 2+ , outputOptionsColorOptions = Just $ colors+ }++colors :: ColorOptions+colors = ColorOptions+ { colorQuote = colorDullGreenBold+ , colorString = colorVividGreen+ , colorError = colorVividRedBold+ , colorNum = colorVividBlue+ , colorRainbowParens = colorPar+ }++colorPar :: [Builder]+colorPar =+ [ colorVividCyan+ , colorVividBlue+ , colorVividRed+ , colorVividYellow+ , colorVividMagenta+ , colorVividGreen+ , colorDullCyanBold+ , colorDullBlueBold+ , colorDullRedBold+ , colorDullYellowBold+ , colorDullMagentaBold+ , colorDullGreenBold+ ]
+ prints.cabal view
@@ -0,0 +1,34 @@+name: prints+version: 0.1.0.0+synopsis: The Artist Formerly Known as Prints+description: In 1993, in rebellion against Warner Bros., which refused + to release Prince's enormous backlog of music at a steady + pace, he changed his name to an unpronounceable symbol.+homepage: https://github.com/evturn/prints+package-url: https://github.com/evturn/prints.git+author: Evan Turner+maintainer: ev@evturn.com+copyright: Copyright (c) Evan Turner+license: BSD3+license-file: LICENSE+category: Text+build-type: Simple+cabal-version: >= 1.10++extra-source-files: README.md ++library+ build-depends: base >=4.7 && <5+ , hscolour+ , pretty-show+ , pretty-simple+ , text+ , transformers+ exposed-modules: Text.Prints+ other-modules: Text.Prints.Printers.Color+ , Text.Prints.Printers.Simple+ default-language: Haskell2010++source-repository head+ type: git+ location: https://github.com/evturn/prints