Verified Commit 44f2e54d authored by Camil Staps's avatar Camil Staps 🙂

Make allTypeSynonyms lazy in its first result, as it is not always needed

It is for example used as an argument to `prepare_unification`. There
are cases however where this function is only called when unification is
requested by the user, and otherwise no `prepare_unification` call is
made.
parent 0a630efb
......@@ -284,7 +284,7 @@ filterUnifying :: !Type !*CloogleDB -> *CloogleDB
filterUsages :: !(*CloogleDB -> *CloogleDB) ![String] !*CloogleDB -> *CloogleDB
allTypeSynonyms :: !*CloogleDB -> *(!Map Name [TypeDef], !*CloogleDB)
allTypeSynonyms :: !*CloogleDB -> *(Map Name [TypeDef], !*CloogleDB)
alwaysUniquePredicate :: !*CloogleDB -> *(!(String -> Bool), !*CloogleDB)
getExactNameMatches :: !Name !*CloogleDB -> *(![!CloogleEntry!], !*CloogleDB)
getInstances :: !Name !*CloogleDB -> *(![InstanceEntry], !*CloogleDB)
......
......@@ -526,7 +526,7 @@ where
removeDupSorted [x:xs] = [x:removeDupSorted (dropWhile ((==)x) xs)]
removeDupSorted [] = []
allTypeSynonyms :: !*CloogleDB -> *(!Map Name [TypeDef], !*CloogleDB)
allTypeSynonyms :: !*CloogleDB -> *(Map Name [TypeDef], !*CloogleDB)
allTypeSynonyms wrap=:{db,type_synonyms}
# (vals,db) = 'Database.Native'.getValuesByIndices` type_synonyms db
= (fromList
......
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