Last active
May 4, 2022 08:45
-
-
Save chrisdone/f591ea7c1e078a61c9d4c5bb325a85d2 to your computer and use it in GitHub Desktop.
Document cell-load pipeline
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
-- | Load a renamed cell. | |
resolveRenamedCell :: | |
Map Hash (Either LoadError LoadedExpression) | |
-> FillerEnv LoadError | |
-> IsRenamed (Expression Renamed) | |
-> RIO DocumentReader (Either LoadError (IsResolved (Expression Resolved))) | |
resolveRenamedCell globalTypes globalHashes isRenamed = do | |
hasConstraints <- | |
pure $ | |
first LoadGenerateError $ | |
generateRenamed | |
(fmap (fmap loadedExpressionScheme) globalTypes) | |
globalHashes | |
isRenamed? | |
ref <- RIO.newSomeRef 0 | |
binds <- RIO.newSomeRef mempty | |
isSolved <- | |
fmap (first LoadSolveError) $ | |
RIO.runRIO | |
SolveReader {glogfunc = mempty, counter = ref, binds} | |
(solveGenerated hasConstraints)? | |
isGeneralised <- | |
fmap (first LoadGeneraliseError) $ | |
RIO.runRIO GeneraliseReader (generaliseSolved isSolved)? | |
isResolved <- | |
fmap (first LoadResolveError) $ | |
RIO.runRIO ResolveReader (resolveGeneralised isGeneralised)? | |
pure (Right isResolved) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment