instance (Sym_IO_Mode term, Sym_Lambda term) => Sym_IO_Mode (BetaT term)
-- Typing
+instance NameTyOf IO where
+ nameTyOf _c = ["IO"] `Mod` "IO"
+instance NameTyOf IO.Handle where
+ nameTyOf _c = ["IO"] `Mod` "Handle"
+instance NameTyOf IO.IOMode where
+ nameTyOf _c = ["IO"] `Mod` "IOMode"
instance FixityOf IO
instance ClassInstancesFor IO where
- proveConstraintFor _ (TyApp _ (TyConst _ _ q) z)
+ proveConstraintFor _ (TyConst _ _ q :$ z)
| Just HRefl <- proj_ConstKiTy @_ @IO z
= case () of
_ | Just Refl <- proj_Const @Applicative q -> Just Dict
| Just Refl <- proj_Const @Functor q -> Just Dict
| Just Refl <- proj_Const @Monad q -> Just Dict
_ -> Nothing
- proveConstraintFor _ (TyApp _ q (TyApp _ z _a))
+ proveConstraintFor _ (TyConst _ _ q :$ z:@_a)
| Just HRefl <- proj_ConstKiTy @_ @IO z
= case () of
- _ | Just Refl <- proj_ConstTy @MT.MonoFunctor q -> Just Dict
+ _ | Just Refl <- proj_Const @MT.MonoFunctor q -> Just Dict
_ -> Nothing
proveConstraintFor _c _q = Nothing
instance ClassInstancesFor IO.Handle where
- proveConstraintFor _ (TyApp _ q z)
+ proveConstraintFor _ (TyConst _ _ q :$ z)
| Just HRefl <- proj_ConstKiTy @_ @IO.Handle z
= case () of
- _ | Just Refl <- proj_ConstTy @Eq q -> Just Dict
+ _ | Just Refl <- proj_Const @Eq q -> Just Dict
_ -> Nothing
proveConstraintFor _c _q = Nothing
instance ClassInstancesFor IO.IOMode where
- proveConstraintFor _ (TyApp _ (TyConst _ _ q) c)
+ proveConstraintFor _ (TyConst _ _ q :$ c)
| Just HRefl <- proj_ConstKiTy @_ @IO.IOMode c
= case () of
_ | Just Refl <- proj_Const @Enum q -> Just Dict
_ -> Nothing
proveConstraintFor _c _q = Nothing
instance TypeInstancesFor IO where
- expandFamFor _c _len f (TyApp _ z a `TypesS` TypesZ)
+ expandFamFor _c _len f (z:@a `TypesS` TypesZ)
| Just HRefl <- proj_ConstKi @_ @Element f
, Just HRefl <- proj_ConstKiTy @_ @IO z
= Just a