Skip to content

Commit

Permalink
Merge SolverM and InfererM as part of an effort to simplify Inference.
Browse files Browse the repository at this point in the history
  • Loading branch information
dougalm committed Aug 16, 2023
1 parent 3cbde4c commit 900c9e0
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 188 deletions.
4 changes: 4 additions & 0 deletions src/lib/Err.hs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ instance Alternative SearcherM where
Just ans -> return $ Just ans
Nothing -> m2

instance Catchable SearcherM where
SearcherM (MaybeT m) `catchErr` handler = SearcherM $ MaybeT $
m `catchErr` \errs -> runMaybeT $ runSearcherM' $ handler errs

instance Searcher SearcherM where
(<!>) = (<|>)
{-# INLINE (<!>) #-}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Imp.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,7 @@ buildImpFunction cc argHintsTys body = do
return $ ImpFunction impFun $ Abs bs $ ImpBlock decls results

buildImpNaryAbs
:: (SinkableE e, HasNamesE e, RenameE e, HoistableE e)
:: HasNamesE e
=> [(NameHint, IType)]
-> (forall l. (Emits l, DExt n l) => [(Name ImpNameC l, BaseType)] -> SubstImpM i l (e l))
-> SubstImpM i n (Abs (Nest IBinder) (Abs (Nest ImpDecl) e) n)
Expand Down
Loading

0 comments on commit 900c9e0

Please sign in to comment.