nothing working for now

This commit is contained in:
nora 2021-04-07 17:06:36 +02:00
parent bd2d2ba8c5
commit 219f419bae
3 changed files with 27 additions and 6 deletions

View file

@ -3,4 +3,4 @@ module Main where
import Lib
main :: IO ()
main = someFunc
main = main

View file

@ -1,6 +1,29 @@
module Lib
( someFunc
( main
) where
someFunc :: IO ()
someFunc = putStrLn "someFunc"
import System.Environment
import Data.List
import System.IO
main :: IO ()
main = do
args <- getArgs
program <- readFile $ head args
interpret program
data Memory = Memory [Int] Int [Int]
interpret :: String -> IO ()
interpret [] = IO()
interpret [x:xs] = do
eval x
interpret xs
eval :: String -> Memory -> IO Memory
eval s (Memory sx x xs)
| x == "+" = Memory sx (x + 1) xs
| x == "-" = Memory sx (x - 1) xs
otherwise = undefined
eval _ = undefined

View file

@ -1,2 +0,0 @@
main :: IO ()
main = putStrLn "Test suite not yet implemented"