Verified Commit 79a3b84f authored by Camil Staps's avatar Camil Staps
Browse files

Add Arrow to required context of generics

parent c2bc5849
...@@ -182,7 +182,12 @@ makeResult orgsearchtype allsyns usedsyns (entry, annots) db ...@@ -182,7 +182,12 @@ makeResult orgsearchtype allsyns usedsyns (entry, annots) db
applyUnifToTR :: TypeRestriction -> [TypeRestriction] applyUnifToTR :: TypeRestriction -> [TypeRestriction]
applyUnifToTR (Instance c ts) = maybeToList $ Instance c <$> mapM uni ts applyUnifToTR (Instance c ts) = maybeToList $ Instance c <$> mapM uni ts
applyUnifToTR (Derivation g t) = [Derivation g (Type st []) \\ ut <- maybeToList (uni t), Type st _ <- subtypes ut] applyUnifToTR (Derivation g t)
| any isFunc subts = [Derivation g (Arrow Nothing):derivs]
| otherwise = derivs
where
subts = [st \\ ut <- maybeToList (uni t), st <- subtypes ut]
derivs = [Derivation g (Type st []) \\ Type st _ <- subts]
uni :: (Type -> Maybe Type) uni :: (Type -> Maybe Type)
uni = fmap norm o assignAll (map fromUnifyingAssignment unif.assignments) uni = fmap norm o assignAll (map fromUnifyingAssignment unif.assignments)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment