newer ghc

This commit is contained in:
crumbtoo
2024-03-24 08:05:39 -06:00
parent eca712d0d7
commit 344c631dd0
7 changed files with 26 additions and 27 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