Skip to content

Instantly share code, notes, and snippets.

Last active May 4, 2022 08:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Document cell-load pipeline
-- | 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 $
(fmap (fmap loadedExpressionScheme) globalTypes)
ref <- RIO.newSomeRef 0
binds <- RIO.newSomeRef mempty
isSolved <-
fmap (first LoadSolveError) $
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