Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumeAbel authored and Saverio976 committed Dec 13, 2023
1 parent 1402c05 commit 5ffc248
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import Types
import System.IO

printErrors :: (Env) -> IO ()
printErrors (Env defines_ []) = printErrors (Env defines_ ["Unable to compute"])
printErrors (Env defines_ errors_) = mapM_ putStrLn errors_ >> handleInput (Env defines_ [])
printErrors (Env defines_ []) =
printErrors (Env defines_ ["Unable to compute"])
printErrors (Env defines_ errors_) =
mapM_ putStrLn errors_ >> handleInput (Env defines_ [])

checkComputing :: (Env, Maybe Result) -> IO ()
checkComputing (env, Nothing) = printErrors env
Expand Down
4 changes: 1 addition & 3 deletions src/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Data.Int (Int64)

type Symbol = String

data Tree = Number Int64 | Symbol Symbol | Boolean Bool | List [Tree] | Empty
data Tree = Number Int64 | Symbol Symbol | Boolean Bool | List [Tree]

data Define = Define {
symbol :: String,
Expand All @@ -39,7 +39,6 @@ instance Eq Tree where
Symbol a == Symbol b = a == b
Boolean a == Boolean b = a == b
List a == List b = a == b
Empty == Empty = True
_ == _ = False

instance Eq Env where
Expand All @@ -58,7 +57,6 @@ instance Show Tree where
show (Symbol a) = "S:'" ++ a ++ "'"
show (Boolean value) = "B: " ++ show value
show (List list) = "L: " ++ show list
show Empty = "Empty"

instance Show Env where
show (Env { defines = def, errors = err }) =
Expand Down

0 comments on commit 5ffc248

Please sign in to comment.