remove node dependencies from Prelude.newt
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
module Day1
|
||||
|
||||
import Prelude
|
||||
import Node
|
||||
|
||||
digits1 : List Char -> List Int
|
||||
digits1 Nil = Nil
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
module Day2
|
||||
|
||||
import Prelude
|
||||
import Node
|
||||
|
||||
Draw : U
|
||||
Draw = Int × Int × Int
|
||||
@@ -84,6 +85,7 @@ part2 (MkGame n parts :: rest) =
|
||||
|
||||
run : String -> IO Unit
|
||||
run fn = do
|
||||
putStrLn fn
|
||||
text <- readFile fn
|
||||
case mapM parseGame (split (trim text) "\n") of
|
||||
Left err => putStrLn $ "fail " ++ err
|
||||
|
||||
7
aoc2023/Node.newt
Normal file
7
aoc2023/Node.newt
Normal file
@@ -0,0 +1,7 @@
|
||||
module Node
|
||||
|
||||
import Prelude
|
||||
|
||||
pfunc fs : JSObject := "require('fs')"
|
||||
pfunc getArgs : List String := "arrayToList(String, process.argv)"
|
||||
pfunc readFile : (fn : String) -> IO String := "(fn) => (w) => MkIORes(Unit, fs.readFileSync(fn, 'utf8'), w)"
|
||||
Reference in New Issue
Block a user