Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Search m r = Search {
- lookupNames :: r -> m (Set (HashQualified Name))
- lookupRelativeHQRefs' :: SearchType -> HashQualified Name -> m (Set r)
- makeResult :: HashQualified Name -> r -> Set (HashQualified Name) -> m SearchResult
- matchesNamedRef :: Name -> r -> HashQualified Name -> Bool
- data NameSearch m = NameSearch {
- typeSearch :: Search m Reference
- termSearch :: Search m Referent
- hoistSearch :: (forall x. m x -> n x) -> Search m r -> Search n r
- hoistNameSearch :: (forall x. m x -> n x) -> NameSearch m -> NameSearch n
- applySearch :: (Show r, Monad m) => Search m r -> SearchType -> HashQualified Name -> m [SearchResult]
- data SearchType
Documentation
A Search r
is a small bag of functions that is used to power a search for r
s.
There are currently two implementations of this interface:
FromNames
which builds a name search from aNames
object- 'NameSearch.Sqlite which builds a name search that uses a sqlite name lookup index.
You can use the individual methods of a name search or can use applySearch
.
Search | |
|
data NameSearch m Source #
NameSearch | |
|
hoistSearch :: (forall x. m x -> n x) -> Search m r -> Search n r Source #
hoistNameSearch :: (forall x. m x -> n x) -> NameSearch m -> NameSearch n Source #
applySearch :: (Show r, Monad m) => Search m r -> SearchType -> HashQualified Name -> m [SearchResult] Source #
Interpret a Search
as a function from name to search results.
data SearchType #
Whether to search for exact matches or to find definitions by a suffix of their name.
Instances
Show SearchType | |
Defined in Unison.NamesWithHistory showsPrec :: Int -> SearchType -> ShowS # show :: SearchType -> String # showList :: [SearchType] -> ShowS # | |
Eq SearchType | |
Defined in Unison.NamesWithHistory (==) :: SearchType -> SearchType -> Bool # (/=) :: SearchType -> SearchType -> Bool # | |
Ord SearchType | |
Defined in Unison.NamesWithHistory compare :: SearchType -> SearchType -> Ordering # (<) :: SearchType -> SearchType -> Bool # (<=) :: SearchType -> SearchType -> Bool # (>) :: SearchType -> SearchType -> Bool # (>=) :: SearchType -> SearchType -> Bool # max :: SearchType -> SearchType -> SearchType # min :: SearchType -> SearchType -> SearchType # |