newer ghc

This commit is contained in:
crumbtoo
2024-03-24 08:05:39 -06:00
parent 9678d3206a
commit 93ef870e56
7 changed files with 24 additions and 25 deletions

View File

@@ -37,7 +37,7 @@ import Data.Traversable
import GHC.Generics (Generic, Generically(..))
import Debug.Trace
import Data.Functor
import Data.Functor hiding (unzip)
import Data.Functor.Foldable hiding (fold)
import Data.Fix hiding (cata, para)
import Control.Comonad.Cofree
@@ -121,6 +121,12 @@ generalise g t = ifoldr (\n _ s -> ForallT n s) t vs
vs = H.difference (freeVariables t ^. hashMap)
(g ^. contextTyVars)
instantiate :: Type PsName -> HM (Type PsName)
instantiate (ForallT x m) = do
tv <- freshTv
subst x tv <$> instantiate m
instantiate x = pure x
unify :: [Constraint] -> HM [(PsName, Type PsName)]
unify [] = pure mempty