newer ghc
This commit is contained in:
@@ -22,7 +22,7 @@ import Text.Printf
|
||||
import Control.Comonad
|
||||
import Control.Comonad.Cofree
|
||||
import Data.Fix
|
||||
import Data.Functor
|
||||
import Data.Functor hiding (unzip)
|
||||
|
||||
import Control.Lens hiding ((:<))
|
||||
import Control.Lens.Unsound
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -30,7 +30,6 @@ import Numeric
|
||||
import Data.Fix hiding (cata, para, cataM)
|
||||
import Data.Functor.Bind
|
||||
import Data.Functor.Foldable
|
||||
import Data.Functor.Foldable.Monadic
|
||||
import Control.Comonad
|
||||
|
||||
import Effectful.State.Static.Local
|
||||
@@ -103,11 +102,7 @@ typeToCore (VarT n) = TyVar n
|
||||
exprToCore :: (NameSupply :> es)
|
||||
=> TypedRlpExpr PsName
|
||||
-> Eff es (Cofree (Core.ExprF Var) Core.Type)
|
||||
exprToCore = cataM \case
|
||||
t :<$ InL e -> pure $ t' :< annotateVar t' e
|
||||
where t' = typeToCore t
|
||||
-- InL e -> pure . annotateVars . Fix $ e
|
||||
-- InR e -> rlpExprToCore e
|
||||
exprToCore = undefined
|
||||
|
||||
annotateVar :: Core.Type -> Core.ExprF PsName a -> Core.ExprF Var a
|
||||
|
||||
|
||||
Reference in New Issue
Block a user