Language record
Haskell
Haskell is indexed with instance resolution treated as a first-class question: an instance's methods are matched against the class it implements and published as overrides, while a data type carries its constructors — GADT constructors included — and its record fields.
The registry row this page is generated from
Read at render time from the same family row the register reads, so nothing in this block can disagree with it.
- Extensions
- .hs, .lhs
- Registry names
haskell- Recorded symbols
- modules · type classes · data types
Relationship types this analyzer constructs
12 of 14 constructed, read from this analyzer's source and re-derived by the languages gate. Each row below is one of the engine's types, in the engine's own order.
| Relationship type | Constructed |
|---|---|
calls | constructed by this analyzer |
extends | constructed by this analyzer |
implements | constructed by this analyzer |
uses | constructed by this analyzer |
imports | constructed by this analyzer |
exports | constructed by this analyzer |
contains | constructed by this analyzer |
references | constructed by this analyzer |
overrides | constructed by this analyzer |
instantiates | constructed by this analyzer |
decorates | constructed by this analyzer |
renders | ruled absent |
mixes_in | ruled absent |
part_of | constructed by this analyzer |
12 constructed, 2 not constructed. All 2 absent types are recorded as ruled absent: the written reason and the corpus measurement behind each are in this family's completeness record. The register explains what each label means.
What this analyzer does not resolve
- A local call resolves only against names this module declares: an imported function, a Prelude name and a parameter all produce no edge, because nothing in the file says which one was meant. Forward references, self-recursion and mutual recursion inside the module do resolve.
- An instance method the class does not declare is not published as an override — the graph would be asserting a contract that does not exist in the source.
- Template Haskell is not read, so a splice's generated declarations are invisible and a module's recorded surface can be smaller than what the compiler actually exports.
Every line above was written against Haskell’s own analyzer module and is named against a construct in it, so it can be checked against the source. Nothing here is inherited from a template, or from another language’s page.
Where you meet it in a repository
Recognised by extension — .hs, .lhs. Everything below is about where those files actually sit in a working repository.
- A Cabal project splits a library into modules that write their export lists explicitly, so the public surface is stated in the file rather than inferred from it.
- Type classes and their instances are separated: the class lives with the abstraction, the instances with the concrete types.
- A foreign import declaration is the one place a Haskell file names a symbol that lives outside itself, and it is recorded as a reference to that external name.
Questions this index answers
Phrased as retrievals, because that is what an index can honestly do: it holds the symbols and the edges between them, and hands them back with the evidence attached.
- Which instances implement this type class?
- Which methods does this instance implement?
- Which constructors does this data type have?
- Which modules import this one, and what does each export?
What the analyzer sees in code like this
module Data.Cart (Cart(..), place) where -- bb records: module · exports Cart, place
data Cart = Cart { cartId :: !Int, total :: !Int } -- bb records: type Cart · field total
class Chargeable a where
charge :: a -> Int -- bb records: interface Chargeable
instance Chargeable Cart where
charge c = cartTotal c -- bb records: an override of the class methodSymbols are stored with the file they came from and the bytes they span, so a hit points at a line rather than at a guess. The annotations in the sample are commentary for the reader, not strings the index would store.
Languages that turn up in the same repository
Functional & declarative — the count beside each name is how many relationship types that family’s analyzer constructs.
The extensions, registry names, recorded symbols and relationship types above are the parser registry row for Haskell, read while the page rendered — the same row the register reads, so the two surfaces cannot tell two stories. Every relationship type listed as constructed appears in src/ast/real-*, the analyzer modules bb ships. bb 0.1.0 answers from a local store over 50 languages (53 registry ids, three of them aliases). There is no benchmark on this page: every claim here is one you can go and read in the source.