@@ -570,45 +570,6 @@ renameBeta oldName newName t =
570570 renamer :: Id -> Id
571571 renamer id = if id == oldName then newName else id
572572
573- renameBetaInvert :: (? globals :: Globals )
574- => Span
575- -- Explain how coeffects should be related by a solver constraint
576- -> (Span -> Coeffect -> Coeffect -> Type -> Constraint )
577- -> Type -- name
578- -> Type -- type
579- -- Indicates whether the first type or second type is a specification
580- -> SpecIndicator
581- -- Flag to say whether this type is actually an effect or not
582- -> Mode
583- -> Checker (Type , Substitution )
584-
585- -- Ref case
586- -- i.e., Rename id a = Ref id' a'
587- -- therefore check `id ~ id'` and then recurse
588- renameBetaInvert sp rel name (TyApp (TyApp (TyCon c) name') s) spec mode
589- | internalName c == " Ref" = do
590- -- Compute equality on names
591- (_, subst) <- equalTypesRelatedCoeffects sp rel name name' spec mode
592- (s, subst') <- renameBetaInvert sp rel name s spec mode
593- substFinal <- combineSubstitutions sp subst subst'
594- return (TyApp (TyApp (TyCon c) name') s, substFinal)
595-
596- renameBetaInvert sp rel name (TyApp (TyCon c) name') spec mode
597- | internalName c == " FloatArray" = do
598- -- Compute equality on names
599- (_, subst) <- equalTypesRelatedCoeffects sp rel name name' spec mode
600- return (TyApp (TyCon c) name', subst)
601-
602- renameBetaInvert sp rel name (TyApp (TyApp (TyCon c) t1) t2) spec mode
603- | internalName c == " ," = do
604- (t1', subst1) <- renameBetaInvert sp rel name t1 spec mode
605- (t2', subst2) <- renameBetaInvert sp rel name t2 spec mode
606- substFinal <- combineSubstitutions sp subst1 subst2
607- return (TyApp (TyApp (TyCon c) t1') t2', substFinal)
608-
609- renameBetaInvert _ _ name t _ _ = return (t, [] )
610-
611- -- Check if `Rename id a ~ a'` which may involve some normalisation in the
612573-- case where `a'` is a variable
613574eqRenameFunction :: (? globals :: Globals )
614575 => Span
@@ -626,23 +587,6 @@ eqRenameFunction sp rel oldName newName t t' ind = do
626587 (eq, u) <- equalTypesRelatedCoeffects sp rel t'' t' ind Types
627588 return (eq, u)
628589
629- -- eqRenameFunction sp rel name t (TyApp (TyApp (TyCon (internalName d -> "Rename")) name') t') ind = do
630- -- (_, subst). <- equalTypesRelatedCoeffects sp rel name name' ind Types
631- -- (eq, subst') <- eqRenameFunction sp rel name t t' ind
632- -- substFinal <- combineSubstitutions sp subst subst'
633- -- return (eq, substFinal)
634-
635- -- eqRenameFunction sp rel name (TyVar v) t ind = do
636- -- (t', subst) <- renameBetaInvert sp rel name t ind Types
637- -- (eq, subst') <- equalTypesRelatedCoeffects sp rel t' (TyVar v) ind Types
638- -- substFinal <- combineSubstitutions sp subst subst'
639- -- return (eq, substFinal)
640-
641- -- eqRenameFunction sp rel name t t' ind = do
642- -- t'' <- renameBeta name t
643- -- (eq, u) <- equalTypesRelatedCoeffects sp rel t'' t' ind Types
644- -- return (eq, u)
645-
646590-- | Is this protocol dual to the other?
647591isDualSession :: (? globals :: Globals )
648592 => Span
0 commit comments