Haskell Query API
To use the Haskell API:
import Glean
import Glean.Angle
Or import qualified if you prefer:
import qualified Glean
import qualified Glean.Angle as Angle
- Haskell query API
- Angle DSL - a library for building type-safe Angle queries
- Simple example client
- Example: Hyperlink: browse hyperlinked code
- Example: Search for definitions by name
Using Haxlβ
Glean comes with a Haxl API for performing queries. The advantages of using the Haxl API are:
Queries can be performed concurrently without using explicit threads or
Control.Concurrent.Async. Applicative combinators such assequenceormapMare performed concurrently in theHaxlmonad, and GHC'sApplicativeDoextension can be used to enable implicit concurrency within a sequence of statements in adoexpression.When traversing the results of a query, instead of using the
expandquery modifier to recursively fetch the entire result, Haxl provides a family ofgetoperations to iteratively fetch nested facts in the result. When performed concurrently in theHaxlmonad, multiple calls togetare batched into a single request to Glean. This makes it efficient to do shallow queries and then selectively traverse and expand the results as needed.
To use the API, import Glean.Haxl. The implementation of the API is in glean/haxl/Haxl/DataSource/Glean.hs.