pretty printer
uses ISeq, as described in 'Implementing Functional Languages'. going to try using a style similar to ShowS instead.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
module Core where
|
||||
----------------------------------------------------------------------------------
|
||||
import Data.Coerce
|
||||
import Data.Pretty
|
||||
----------------------------------------------------------------------------------
|
||||
|
||||
data Expr = Var Name
|
||||
@@ -39,6 +40,11 @@ newtype Program = Program [ScDef]
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
|
||||
instance Pretty Expr where
|
||||
prettyPrec _ (Var k) = iStr k
|
||||
|
||||
----------------------------------------------------------------------------------
|
||||
|
||||
instance Semigroup Program where
|
||||
(<>) = coerce $ (++) @ScDef
|
||||
|
||||
|
||||
Reference in New Issue
Block a user