more effect stuff, incl. ST

This commit is contained in:
rhiannon morris 2023-08-25 18:09:06 +02:00
parent 4b6b3853a1
commit a221380d61
17 changed files with 395 additions and 204 deletions

View file

@ -2,12 +2,14 @@ module Tests.Equal
import Quox.Equal
import Quox.Typechecker
import Quox.ST
import public TypingImpls
import TAP
import Quox.EffExtra
import AstExtra
defGlobals : Definitions
defGlobals = fromList
[("A", ^mkPostulate gzero (^TYPE 0)),

View file

@ -68,7 +68,7 @@ parameters {c : Bool} {auto _ : Show b}
runFromParser : {default empty defs : Definitions} ->
Eff FromParserPure a -> Either FromParser.Error a
runFromParser = map fst . fst . fromParserPure 0 defs
runFromParser = map fst . fromParserPure 0 defs
export
tests : Test

View file

@ -2,6 +2,7 @@ module Tests.Reduce
import Quox.Syntax as Lib
import Quox.Equal
import Quox.ST
import TypingImpls
import AstExtra
import TAP
@ -11,6 +12,10 @@ import Control.Eff
%hide Pretty.App
runWhnf : Eff Whnf a -> Either Error a
runWhnf act = runSTErr $ do
runEff act [handleStateSTRef !(newRef 0), handleExcept (\e => stLeft e)]
parameters {0 isRedex : RedexTest tm} {auto _ : CanWhnf tm isRedex} {d, n : Nat}
{auto _ : (Eq (tm d n), Show (tm d n))}
{default empty defs : Definitions}

View file

@ -2,6 +2,7 @@ module Tests.Typechecker
import Quox.Syntax
import Quox.Typechecker as Lib
import Quox.ST
import public TypingImpls
import TAP
import Quox.EffExtra