conIndexName : Named a => a -> Name- Totality: total
Visibility: export conIndexTypes : Nat -> (Bits32 -> TTImp, TTImp) Type used to represent the index of a data constructor.
Totality: total
Visibility: exportconIndexClauses : Named a => Name -> List a -> List Clause Clauses returning the index for each constructor in the given
list.
Totality: total
Visibility: exportconIndexClaim : Visibility -> Name -> TypeInfo -> Decl Declaration of a function returning the constructor index
for a value of the given data type.
Totality: total
Visibility: exportconIndexDef : Name -> TypeInfo -> Decl Definition of a function returning the constructor index
for a value of the given data type.
Totality: total
Visibility: exportConIndexVis : Visibility -> List Name -> ParamTypeInfo -> Res (List TopLevel) For the given data type, creates a function for returning
a 0-based index for each constructor.
For instance, for `Either a b = Left a | Right b` this creates
declarations as follows:
```idris
conIndexEither : Either a b -> Bits8
conIndexEither (Left {}) = 0
conIndexEither (Right {}) = 1
```
This function is useful in several situations: When deriving
`Ord` for a sum type with more than one data constructors, we
can use the constructor index to compare values created from
distinct constructors. This allows us to only use a linear number
of pattern matches to implement the ordering.
For enum types (all data constructors have only erased arguments - if any),
there are even greater benefits: `conIndex` is
the identity function at runtime, being completely eliminated during
code generations. This allows us to get `Eq` and `Ord` implementations for
enum types, which run in O(1)!
Totality: total
Visibility: exportConIndex : List Name -> ParamTypeInfo -> Res (List TopLevel) Alias for `ConIndexVis Public`
Totality: total
Visibility: exporteqClaim : Visibility -> Name -> ParamTypeInfo -> Decl Top-level declaration implementing the equality test for
the given data type.
Totality: total
Visibility: exporteqImplClaim : Visibility -> Name -> ParamTypeInfo -> Decl Top-level declaration implementing the `Eq` interface for
the given data type.
Totality: total
Visibility: exporteqClauses : List Name -> Name -> TypeInfo -> List Clause Generates pattern match clauses for the constructors of
the given data type. `fun` is the name of the function we implement.
This is either a local function definition in case of a
custom derivation, or the name of a top-level function.
Totality: total
Visibility: exporteqDef : List Name -> Name -> TypeInfo -> Decl Definition of a (local or top-level) function implementing
the equality check for the given data type.
Totality: total
Visibility: exportderiveEq : Elab (Eq f) Derive an implementation of `Eq a` for a custom data type `a`.
Note: This is mainly to be used for indexed data types. Consider using
`derive` together with `Derive.Eq.Eq` for parameterized data types.
Totality: total
Visibility: exportEqVis : Visibility -> List Name -> ParamTypeInfo -> Res (List TopLevel) Generate declarations and implementations for `Eq` for a given data type.
Totality: total
Visibility: exportEq : List Name -> ParamTypeInfo -> Res (List TopLevel) Alias for `EqVis Public`
Totality: total
Visibility: export