diff --git a/Cloogle/DB.dcl b/Cloogle/DB.dcl index 33feef208c46aa878f8c14a028b906992153fdbe..ac315eae0ac6399eb1861686fdc4ddb92a1c606a 100644 --- a/Cloogle/DB.dcl +++ b/Cloogle/DB.dcl @@ -270,6 +270,7 @@ writeTypeTree :: !*CloogleDB !*File -> *(*CloogleDB, *File) getIndex :: !Index !*CloogleDB -> *(Entry CloogleEntry Annotation, *CloogleDB) getIndices :: ![Index] !*CloogleDB -> *([Entry CloogleEntry Annotation], *CloogleDB) +getIndices` :: !{#Index} !*CloogleDB -> *([Entry CloogleEntry Annotation], *CloogleDB) filterDB :: (CloogleEntry -> Bool) !*CloogleDB -> *CloogleDB excludeCore :: !*CloogleDB -> *CloogleDB diff --git a/Cloogle/DB.icl b/Cloogle/DB.icl index 1816b21a887b1a6e6ec2792dcece66508c8901b7..265ab74ff35408ecf38d5f2fa378a08947bcced7 100644 --- a/Cloogle/DB.icl +++ b/Cloogle/DB.icl @@ -347,6 +347,11 @@ getIndices idxs wrap=:{db} # (es,db) = 'Database.Native'.getIndices idxs db = (es, {wrap & db=db}) +getIndices` :: !{#Index} !*CloogleDB -> *([Entry CloogleEntry Annotation], *CloogleDB) +getIndices` idxs wrap=:{db} +# (es,db) = 'Database.Native'.getIndices` idxs db += (es, {wrap & db=db}) + filterDB :: (CloogleEntry -> Bool) !*CloogleDB -> *CloogleDB filterDB f db = {db & db = 'Database.Native'.search Intersect (\v -> (f v, [])) db.db} diff --git a/Cloogle/Search.icl b/Cloogle/Search.icl index 080236d0cb2d75e71d7a29a5616c21b225d55e20..1a315d201ef039f6a6df09d04969baa7a8fb3877 100644 --- a/Cloogle/Search.icl +++ b/Cloogle/Search.icl @@ -193,7 +193,7 @@ makeResult orgsearchtype allsyns usedsyns (entry, annots) db // Derivations # (derivs,db) = case fe.fe_derivations of Nothing -> (Nothing, db) - Just ds -> appFst Just $ getIndices ds db + Just ds -> appFst Just $ getIndices` ds db = (Just $ FunctionResult ( { general & distance = distance entry annots @@ -234,8 +234,8 @@ makeResult orgsearchtype allsyns usedsyns (entry, annots) db | entry =: (TypeDefEntry _) # (TypeDefEntry tde) = entry - # (insts,db) = getIndices tde.tde_instances db - # (derivs,db) = getIndices tde.tde_derivations db + # (insts,db) = getIndices` tde.tde_instances db + # (derivs,db) = getIndices` tde.tde_derivations db = (Just $ TypeResult ( { general & documentation = docDescription =<< tde.tde_doc @@ -262,8 +262,8 @@ makeResult orgsearchtype allsyns usedsyns (entry, annots) db | entry =: (ClassEntry _) # (ClassEntry ce) = entry - # (ies,db) = getIndices ce.ce_instances db - # (mems,db) = getIndices ce.ce_members db + # (ies,db) = getIndices` ce.ce_instances db + # (mems,db) = getIndices` ce.ce_members db = (Just $ ClassResult ( { general & documentation = docDescription =<< ce.ce_documentation