-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into mariari/LLVM
- Loading branch information
Showing
48 changed files
with
1,489 additions
and
824 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ jobs: | |
- run: | ||
name: Run tests | ||
command: stack test | ||
no_output_timeout: 1200 | ||
|
||
workflows: | ||
version: 2.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module Monad where | ||
|
||
import Juvix.Core.Parameterisations.Naturals | ||
import qualified Juvix.Core.Types as Core | ||
import Juvix.Library hiding (log) | ||
|
||
exec ∷ EnvExec NatTy NatVal a → IO (Either (Core.PipelineError NatTy NatVal) a, [Core.PipelineLog NatTy NatVal]) | ||
exec (EnvE env) = do | ||
(ret, env) ← runStateT (runExceptT env) (Env nat []) | ||
pure (ret, log env) | ||
|
||
data Env primTy primVal | ||
= Env | ||
{ parameterisation ∷ Core.Parameterisation primTy primVal, | ||
log ∷ [Core.PipelineLog primTy primVal] | ||
} | ||
deriving (Generic) | ||
|
||
newtype EnvExec primTy primVal a = EnvE (ExceptT (Core.PipelineError primTy primVal) (StateT (Env primTy primVal) IO) a) | ||
deriving (Functor, Applicative, Monad, MonadIO) | ||
deriving | ||
( HasStream "log" [Core.PipelineLog primTy primVal], | ||
HasWriter "log" [Core.PipelineLog primTy primVal] | ||
) | ||
via WriterLog (Field "log" () (MonadState (ExceptT (Core.PipelineError primTy primVal) (StateT (Env primTy primVal) IO)))) | ||
deriving | ||
-- TODO: Should be HasReader, this library is finicky. | ||
(HasState "parameterisation" (Core.Parameterisation primTy primVal)) | ||
via (Field "parameterisation" () (MonadState (ExceptT (Core.PipelineError primTy primVal) (StateT (Env primTy primVal) IO)))) | ||
deriving | ||
(HasThrow "error" (Core.PipelineError primTy primVal)) | ||
via MonadError (ExceptT (Core.PipelineError primTy primVal) (StateT (Env primTy primVal) IO)) |
Binary file not shown.
Oops, something went wrong.