Verified Commit 5e6e2771 authored by Camil Staps's avatar Camil Staps 🙂

Update to changes in Platform

parent b20e618d
......@@ -66,14 +66,16 @@ derive JSONEncode ClassDoc, ClassEntry, ClassMemberDoc, CloogleEntry,
Constructor, ConstructorDoc, DeriveEntry, FunctionDoc, FunctionEntry,
InstanceEntry, Location, ModuleDoc, ModuleEntry, Priority, RecordField,
SyntaxEntry, Type, TypeDef, TypeDefEntry, TypeDefRhs, TypeDoc, ParamDoc,
TypeRestriction, ABCInstructionEntry, Property, PropertyVarInstantiation,
MultiLineString, NGramIndex, PropertyTestGenerator, Regex, GroupId
TypeContext, TypeRestriction, ABCInstructionEntry, Property,
PropertyVarInstantiation, MultiLineString, NGramIndex,
PropertyTestGenerator, Regex, GroupId
derive JSONDecode ClassDoc, ClassEntry, ClassMemberDoc, CloogleEntry,
Constructor, ConstructorDoc, DeriveEntry, FunctionDoc, FunctionEntry,
InstanceEntry, Location, ModuleDoc, ModuleEntry, Priority, RecordField,
SyntaxEntry, Type, TypeDef, TypeDefEntry, TypeDefRhs, TypeDoc, ParamDoc,
TypeRestriction, ABCInstructionEntry, Property, PropertyVarInstantiation,
MultiLineString, NGramIndex, PropertyTestGenerator, Regex, GroupId
TypeContext, TypeRestriction, ABCInstructionEntry, Property,
PropertyVarInstantiation, MultiLineString, NGramIndex,
PropertyTestGenerator, Regex, GroupId
printersperse :: Bool a [b] -> [String] | print a & print b
printersperse ia a bs = intercalate (print False a) (map (print ia) bs)
......@@ -226,7 +228,7 @@ toClass loc vs meta cc doc =
}
classContext :: !ClassEntry -> [TypeRestriction]
classContext ce = ce.ce_context
classContext {ce_context=TypeContext tc} = tc
saveDB :: !*CloogleDB !*File -> *(!*CloogleDB, !*File)
saveDB wrapper=:{db,name_ngrams,name_map,types,core,apps,builtins,syntax,
......
......@@ -138,10 +138,14 @@ where
= appFst Just $
mapSt (\tr -> appFst (tuple3 (trHasFreeVar tr) (concat $ print False tr) o map locResult) o findLocations tr) trs db
where
getTC :: Type -> TypeContext
getTC (Func _ _ tc) = tc
getTC (Forall _ _ tc) = tc
getTC _ = []
getTC :: Type -> [TypeRestriction]
getTC t = case t of
Func _ _ (TypeContext tc)
-> tc
Forall _ _ (TypeContext tc)
-> tc
_
-> []
applyUnifToTR :: TypeRestriction -> [TypeRestriction]
applyUnifToTR (Instance c ts) = maybeToList $ Instance c <$> mapM uni ts
......@@ -272,7 +276,7 @@ makeResult orgsearchtype allsyns usedsyns (entry, annots) db = case entry of
{ module_is_core = me.me_is_core
}), db)
ClassEntry ce
ClassEntry ce=:{ce_context=TypeContext context}
# (ies,db) = getValuesByIndices` ce.ce_instances db
# (mems,db) = getValuesByIndices` ce.ce_members db
-> (Just $ ClassResult (
......@@ -281,7 +285,7 @@ makeResult orgsearchtype allsyns usedsyns (entry, annots) db = case entry of
},
{ class_name = name
, class_heading = foldl ((+) o (flip (+) " ")) name ce.ce_vars +
if (isEmpty ce.ce_context) "" " | " + concat (print False ce.ce_context)
if (isEmpty context) "" " | " + concat (print False context)
, class_funs = [fromJust fe.fe_representation \\ FunctionEntry fe <|- mems]
, class_fun_doc = Just [printDoc <$> fe.fe_documentation \\ FunctionEntry fe <|- mems]
, class_instances = sortBy ((<) `on` fst)
......
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