Idris2Doc : Generics.SOP

Generics.SOP

(source)

Reexports

importpublic Data.List.Elem
importpublic Data.SOP

Definitions

interfaceGeneric : Type->List (ListType) ->Type
  Interface for converting a data type from and to
its generic representation as a sum of products.

Additional Idris coolness: This comes with proofs
that `from . to = id` and `to . from = id` and
thus, that `t` and `SOP code` are indeed isomorphic.

Parameters: t, code
Constructor: 
MkGeneric

Methods:
from : t->SOPIcode
  Converts the data type to its generic representation.
to : SOPIcode->t
  Converts the generic representation back to the original
value.
fromToId : (v : t) ->to (fromv) =v
  Proof that `to . from = id`.
toFromId : (v : SOPIcode) ->from (tov) =v
  Proof that `from . to = id`.

Implementations:
Generic () [[]]
Generic (a, b) [[a, b]]
Generic (LPairab) [[a, b]]
GenericVoid []
Generic (Streama) [[a, Inf (Streama)]]
from : Generictcode=>t->SOPIcode
  Converts the data type to its generic representation.

Totality: total
Visibility: public export
to : Generictcode=>SOPIcode->t
  Converts the generic representation back to the original
value.

Totality: total
Visibility: public export
fromToId : {auto__con : Generictcode} -> (v : t) ->to (fromv) =v
  Proof that `to . from = id`.

Totality: total
Visibility: public export
toFromId : {auto__con : Generictcode} -> (v : SOPIcode) ->from (tov) =v
  Proof that `from . to = id`.

Totality: total
Visibility: public export
fromInjective : {auto{conArg:13450} : Generictcode} -> (0x : t) -> (0y : t) ->fromx=fromy->x=y
Totality: total
Visibility: export
0Code : (t : Type) ->Generictcode=>List (ListType)
Totality: total
Visibility: public export
genExtract : (0ts : ListType) ->t->Generictcode=>Elemtscode=>Maybe (NPIts)
  Tries to extract the arguments of a single constructor
from a value's generic representation.

Totality: total
Visibility: public export
genExtract1 : (0t' : Type) ->t->Generictcode=>Elem [t'] code=>Maybet'
  Tries to extract the value of a single one argument
constructor from a value's generic representation.

Totality: total
Visibility: public export
valuesNP : Generictcode=>EnumTypecode=>NP_ (ListType) (Kt) code
  Returns all value from a generic enum type
(all nullary constructors) wrapped in homogeneous n-ary product.

Totality: total
Visibility: public export
values : Generictcode=>EnumTypecode=>Listt
  Returns all value from a generic enum type
(all nullary constructors) wrapped in a list.

Totality: total
Visibility: public export
valuesForNP : (0t : Type) ->Generictcode=>EnumTypecode=>NP_ (ListType) (Kt) code
  Like `valuesNP` but takes the erased value type as an
explicit argument to help with type inference.

Totality: total
Visibility: public export
valuesFor : (0t : Type) ->Generictcode=>EnumTypecode=>Listt
  Like `values` but takes the erased value type as an
explicit argument to help with type inference.

Totality: total
Visibility: public export
genEq : Generictcode=>POPEqcode=>t->t->Bool
  Default `(==)` implementation for data types with a `Generic`
instance.

Totality: total
Visibility: public export
genCompare : Generictcode=>POPOrdcode=>t->t->Ordering
  Default `compare` implementation for data types with a `Generic`
instance.

Totality: total
Visibility: public export
genDecEq : Generictcode=>POPDecEqcode=> (x : t) -> (y : t) ->Dec (x=y)
  Default `decEq` implementation for data types with a `Generic`
instance.

Totality: total
Visibility: public export
genAppend : Generict [ts] =>POPSemigroup [ts] =>t->t->t
  Default `(<+>)` implementation for data types with a `Generic`
instance.

Totality: total
Visibility: public export
genNeutral : Generict [ts] =>POPMonoid [ts] =>t
  Default `neutral` implementation for data types with a `Generic`
instance.

Totality: total
Visibility: public export