diff options
author | Alexander Foremny <aforemny@posteo.de> | 2024-02-09 07:16:35 +0100 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2024-02-09 07:24:10 +0100 |
commit | 9e552700b1ac0d0812956a90845ddf6889c0218d (patch) | |
tree | 994858cd19dde2c574c6214106bedb6a2c0722cd | |
parent | 11969ba7aed38e6e35d51d52e8eab9b46a0c6203 (diff) |
refactor `Debug`
-rw-r--r-- | app/Debug.hs | 7 | ||||
-rw-r--r-- | app/Main.hs | 5 | ||||
-rw-r--r-- | json2sql.cabal | 1 |
3 files changed, 8 insertions, 5 deletions
diff --git a/app/Debug.hs b/app/Debug.hs new file mode 100644 index 0000000..b28a967 --- /dev/null +++ b/app/Debug.hs @@ -0,0 +1,7 @@ +module Debug where + +import Debug.Trace (trace) +import Text.Printf (printf) + +debug :: Show a => String -> a -> a +debug s x = trace (printf "%s: %s" s (show x)) x diff --git a/app/Main.hs b/app/Main.hs index 9f04849..4ccf455 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -14,17 +14,12 @@ import Data.Maybe (fromMaybe, mapMaybe) import Data.Set qualified as S import Data.String (IsString (fromString)) import Data.Text qualified as T -import Debug.Trace (trace) import Store qualified as S import System.Directory (setCurrentDirectory) import System.FilePath ((</>)) import Text.Megaparsec qualified as P import Text.Megaparsec.Char qualified as P import Text.Megaparsec.Char.Lexer qualified as P -import Text.Printf (printf) - -debug :: Show a => String -> a -> a -debug s x = trace (printf "%s: %s" s (show x)) x main :: IO () main = do diff --git a/json2sql.cabal b/json2sql.cabal index 63c083c..fdd0aac 100644 --- a/json2sql.cabal +++ b/json2sql.cabal @@ -19,6 +19,7 @@ executable json2sql import: warnings main-is: Main.hs other-modules: + Debug Store -- other-extensions: build-depends: base ^>=4.16.4.0, |