From 54bcc4595f28ba76384b5f018d72bca353cd88d3 Mon Sep 17 00:00:00 2001 From: tzlil Date: Sat, 15 Apr 2023 01:54:47 +0300 Subject: fourmolu formatting --- src/AST.hs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/AST.hs') diff --git a/src/AST.hs b/src/AST.hs index 456338e..6f21d9e 100644 --- a/src/AST.hs +++ b/src/AST.hs @@ -1,28 +1,23 @@ -- | Abstract syntax tree for the untyped lambda calculus, plus some helpers. module AST ( - Expr (..) + Expr (..), ) where -- | Lambda Expressions data Expr - = Var String - | Lam String Expr - | App Expr Expr - deriving (Eq, Ord) - + = Var String + | Lam String Expr + | App Expr Expr + deriving (Eq, Ord) -- https://www.haskellforall.com/2020/11/pretty-print-syntax-trees-with-this-one.html showLam, showApp, showVar :: Expr -> String showLam (Lam i e) = "\\" ++ i ++ " . " ++ showLam e showLam e = showApp e - showApp (App e1 e2) = showApp e1 ++ " " ++ showVar e2 showApp e = showVar e - showVar (Var i) = i showVar e = "(" ++ showLam e ++ ")" instance Show Expr where - show e = showLam e - - + show e = showLam e -- cgit 1.4.1