aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Helper.hs
diff options
context:
space:
mode:
authorMarvin Borner2022-06-30 19:40:21 +0200
committerMarvin Borner2022-06-30 19:40:21 +0200
commit9d8efb7dfa56576c779244af633481ee7e986060 (patch)
tree45ad0e6ab436c53afc5632ff741220951c78525f /src/Helper.hs
parent247ed56bdec4db2122afeab0facfa8b2ea0693b9 (diff)
Config, colors and completion
(the three c's were completely random btw)
Diffstat (limited to 'src/Helper.hs')
-rw-r--r--src/Helper.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Helper.hs b/src/Helper.hs
index 0045bd1..d45a02b 100644
--- a/src/Helper.hs
+++ b/src/Helper.hs
@@ -15,10 +15,11 @@ data Expression = Bruijn Int | Variable String | Abstraction Expression | Applic
data Instruction = Define String Expression | Evaluate Expression | Comment String | Import String | Test Expression Expression
deriving (Show)
instance Show Expression where
- show (Bruijn x ) = show x
- show (Variable var ) = var
- show (Abstraction exp ) = "[" <> show exp <> "]"
- show (Application exp1 exp2) = "(" <> show exp1 <> " " <> show exp2 <> ")"
+ show (Bruijn x ) = "\ESC[31m" <> show x <> "\ESC[0m"
+ show (Variable var) = "\ESC[35m" <> var <> "\ESC[0m"
+ show (Abstraction exp) = "\ESC[36m[\ESC[0m" <> show exp <> "\ESC[36m]\ESC[0m"
+ show (Application exp1 exp2) =
+ "\ESC[33m(\ESC[0m" <> show exp1 <> " " <> show exp2 <> "\ESC[33m)\ESC[0m"
type Environment = [(String, Expression)]
type Program = State Environment