]> Git — Sourcephile - tmp/julm/symantic.git/blob - src/Symantic/Printer.hs
init
[tmp/julm/symantic.git] / src / Symantic / Printer.hs
1 module Symantic.Printer where
2
3 import Control.Applicative (Applicative (..))
4 import Control.Monad (Monad (..))
5 import Control.Monad.Trans.Except qualified as MT
6 import Control.Monad.Trans.Reader qualified as MT
7 import Control.Monad.Trans.State qualified as MT
8 import Data.Bool (otherwise)
9 import Data.Either (Either (..))
10 import Data.Eq (Eq (..))
11 import Data.Function (id, ($), (.))
12 import Data.Functor (Functor (..), (<$>))
13 import Data.Functor.Constant (Constant (..))
14 import Data.Int (Int)
15 import Data.Kind (Constraint, Type)
16 import Data.Maybe (Maybe (..), isJust)
17 import Data.Proxy (Proxy (..))
18 import Data.Semigroup (Semigroup (..))
19 import Data.String (String)
20 import GHC.Types
21 import Text.Read (Read (..), reads)
22 import Text.Show (Show (..))
23 import Unsafe.Coerce (unsafeCoerce)
24 import Prelude (error)
25 import Prelude qualified
26
27 import Symantic.Compiler
28 import Symantic.Parser
29
30 newtype Printer a = Printer {unPrinter :: TermAST}
31 print :: Printer a -> TermAST
32 print = unPrinter
33 print2 :: String -> Printer a1 -> Printer a2 -> Printer a3
34 print2 n (Printer aT) (Printer bT) = Printer $ BinTree2 (BinTree2 (BinTree0 (TokenTermAtom n)) aT) bT