init
authorJulien Moutinho <julm@sourcephile.fr>
Thu, 10 Aug 2023 01:34:04 +0000 (03:34 +0200)
committerJulien Moutinho <julm@sourcephile.fr>
Thu, 10 Aug 2023 01:34:04 +0000 (03:34 +0200)
src/Symantic/Syntaxes.hs

index 1a7fafe6349fcffe933e9d80894e1db787dd3ad7..38fbe351c4ceb122e8b3215c06124d1004329978 100644 (file)
@@ -6,8 +6,9 @@
 {-# LANGUAGE ViewPatterns #-}
 {-# LANGUAGE NoMonomorphismRestriction #-}
 {-# OPTIONS_GHC -Wno-missing-signatures #-}
+{-# OPTIONS_GHC -Wno-orphans #-}
+
 -- {-# OPTIONS_GHC -Wno-monomorphism-restriction #-}
-{-# OPTIONS_GHC -freduction-depth=400 #-}
 
 module Symantic.Syntaxes where
 
@@ -20,7 +21,8 @@ import Data.Maybe (Maybe (..))
 import Data.Monoid (Monoid (..))
 import Data.Semigroup (Semigroup (..))
 import Data.Void (Void)
-import Debug.Trace
+
+-- import Debug.Trace
 import Text.Show (Show (..))
 import Type.Reflection (eqTypeRep, typeRep, (:~~:) (..))
 import Prelude (error)
@@ -219,10 +221,12 @@ tree0 = add .@ lit 8 .@ (neg .@ (add .@ lit 1 .@ lit 2))
 
 -- tree1 = mul (add (lit 8) (neg (add (lit 1) (lit 2)))) (lit 2)
 tree2 = lam (typeOf @()) (\(x :: sem Int) -> add .@ x .@ lit 0)
+tree3 = lam (typeOf @()) (\(x :: sem Int) -> add .@ x .@ x)
 tree0Print = print tree0
 
 -- tree1Print = print tree1
 tree2Print = print tree2
+tree3Print = print tree3
 
 tree0ParsePrint :: TermAST ()
 tree0ParsePrint = case parse @(FinalSyntaxes ()) @() tree0Print of
@@ -238,3 +242,8 @@ tree2ParsePrint :: TermAST ()
 tree2ParsePrint = case parse @(FinalSyntaxes ()) @() tree2Print of
   Left e -> error e
   Right (TermVT _ty (runOTerm -> ForallSem sem)) -> print sem
+
+tree3ParsePrint :: TermAST ()
+tree3ParsePrint = case parse @(FinalSyntaxes ()) @() tree3Print of
+  Left e -> error e
+  Right (TermVT _ty (runOTerm -> ForallSem sem)) -> print sem