summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorstuebinm2021-09-18 00:27:22 +0200
committerstuebinm2021-09-18 00:27:22 +0200
commitb17396b2eeefdf113b862b254cb152557bebf68d (patch)
tree09ab8776b87a7c193d08144b3d40ecd4f249f11e /src/Main.hs
parentbfe45dc4996537b72436f4041d0ca819aa3444e1 (diff)
tame the strings
Adds a PrettyPrint typeclass which operates on Text and should replace Show, since constantly converting strings from linked lists to arrays seems somewhat silly.
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 7884cf9..969fa10 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -1,21 +1,22 @@
-{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
module Main where
-import Data.Maybe (fromMaybe)
-import WithCli
-
-import CheckMap (loadAndLintMap)
import Data.Aeson (encode)
import Data.Aeson.Encode.Pretty (encodePretty)
import qualified Data.ByteString.Lazy as LB
import qualified Data.ByteString.Lazy.Encoding as LB
+import Data.Maybe (fromMaybe)
import Data.Text.Lazy as T
import System.IO (utf8)
+import WithCli
+
+import CheckMap (loadAndLintMap)
+import Util (printPretty)
-- | the options this cli tool can take
data Options = Options
@@ -44,7 +45,7 @@ run options = do
if json options
then printLB
$ if pretty options then encodePretty lints else encode lints
- else print lints
+ else printPretty lints
-- | haskell's many string types are FUN …
printLB :: LB.ByteString -> IO ()