funnyprint 0.0.4 → 0.0.5
raw patch · 4 files changed
+12/−11 lines, 4 filesdep −posix-escapePVP ok
version bump matches the API change (PVP)
Dependencies removed: posix-escape
API changes (from Hackage documentation)
Files
- funnyprint.cabal +1/−4
- library/FunnyPrint.hs +10/−2
- package.yaml +1/−4
- stack.yaml +0/−1
funnyprint.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: funnyprint-version: 0.0.4+version: 0.0.5 synopsis: funnyPrint function to colorize GHCi output. description: see FunnyPrint.funnyPrint. category: Text@@ -34,7 +34,6 @@ base >= 2 && < 6 , hscolour , ipprint == 0.6- , posix-escape exposed-modules: FunnyPrint default-language: Haskell2010@@ -49,7 +48,6 @@ base >= 2 && < 6 , hscolour , ipprint == 0.6- , posix-escape , funnyprint , tasty , tasty-hspec@@ -65,7 +63,6 @@ base >= 2 && < 6 , hscolour , ipprint == 0.6- , posix-escape , funnyprint , criterion default-language: Haskell2010
library/FunnyPrint.hs view
@@ -7,7 +7,6 @@ , prompt2 ) where -import System.Posix.Escape.Unicode ( escape ) import IPPrint ( pshow ) import Language.Haskell.HsColour.Output ( TerminalType(..) ) import Language.Haskell.HsColour.Colourise ( Colour(..)@@ -68,11 +67,20 @@ -> IO () funnyPrint = funnyPrint' False +withUTF :: String -> String+withUTF [] = []+withUTF li@(x:xs) | x == '\"' = '\"':str ++ "\"" ++ (withUTF rest)+ | x == '\'' = '\'':chr:'\'':(withUTF rest')+ | otherwise = x:withUTF xs+ where+ (str, rest):_ = reads li :: [(String, String)]+ (chr, rest'):_ = reads li :: [(Char, String)]+ -- | internal helper, use 'funnyPrint' or 'funnyPrintC' funnyPrint' :: (Show a) => Colored -- ^ enable colors in prompt -> a -- ^ printed input -> IO ()-funnyPrint' c = putStrLn .escape . if c then colorize . pshow else pshow+funnyPrint' c = putStrLn .withUTF . if c then colorize . pshow else pshow where prefs = TTYg term colorize = hscolour prefs colours False False "" False
package.yaml view
@@ -7,7 +7,6 @@ - base >= 2 && < 6 - hscolour - ipprint == 0.6- - posix-escape - funnyprint - criterion ghc-options:@@ -31,7 +30,6 @@ - base >= 2 && < 6 - hscolour - ipprint == 0.6- - posix-escape source-dirs: library license: MIT license-file: LICENSE.md@@ -44,7 +42,6 @@ - base >= 2 && < 6 - hscolour - ipprint == 0.6- - posix-escape - funnyprint - tasty - tasty-hspec@@ -54,4 +51,4 @@ - -with-rtsopts=-N main: Main.hs source-dirs: test-suite-version: '0.0.4'+version: '0.0.5'
stack.yaml view
@@ -42,7 +42,6 @@ extra-deps: - ipprint-0.6 - sr-extra-1.46.3.2- - posix-escape-0.1 # Override default flag values for local packages and extra-deps flags: {}