From 4424918cb5d57b1caaf27b5645fbc4b0c8c2e8f2 Mon Sep 17 00:00:00 2001 From: Kamil Adam Date: Sun, 18 Aug 2024 21:34:26 +0200 Subject: [PATCH] WIP --- docs/developers/CHANGELOG.md | 3 +++ docs/reports/hlint.html | 2 +- hs/src/HelVM/HelPS/Quest/Compiler.hs | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 hs/src/HelVM/HelPS/Quest/Compiler.hs diff --git a/docs/developers/CHANGELOG.md b/docs/developers/CHANGELOG.md index ce46dc2..bae0061 100644 --- a/docs/developers/CHANGELOG.md +++ b/docs/developers/CHANGELOG.md @@ -1,5 +1,8 @@ # 📅 Revision history for HelPS +## 0.1.0.1 -- 2023-06-18 +* First version. Released on an unsuspecting world. + ## 0.1.0.0 -- 2023-06-18 * First version. Released on an unsuspecting world. diff --git a/docs/reports/hlint.html b/docs/reports/hlint.html index 745824b..c67f85c 100644 --- a/docs/reports/hlint.html +++ b/docs/reports/hlint.html @@ -173,7 +173,7 @@

Report generated by HLint -v3.1.6 +v3.5 - a tool to suggest improvements to your Haskell code.

diff --git a/hs/src/HelVM/HelPS/Quest/Compiler.hs b/hs/src/HelVM/HelPS/Quest/Compiler.hs new file mode 100644 index 0000000..9687457 --- /dev/null +++ b/hs/src/HelVM/HelPS/Quest/Compiler.hs @@ -0,0 +1,20 @@ +module HelVM.HelPS.Quest.Compiler (compile) where + +import qualified HelVM.HelPS.Quest.Grind.Parity as Parity + +compile :: Int -> String -> IO String +--compile n filePath = Parity.compile <$> readRemainingLines n filePath + +compile n filePath = do + contents <- readRemainingLines n filePath + putStrLn contents + let result = Parity.compile contents + putStrLn result + pure result + +readRemainingLines :: Int -> FilePath -> IO String +readRemainingLines n filePath = do + contents <- readFile filePath + let allLines = lines contents + let remainingLines = drop n allLines + pure (unlines remainingLines)