Idris2Doc : Derive.Refined

Derive.Refined

(source)
This module derives functionality for refinement type. In general,
a refinement type is of the following shape:

```idris
record Percent where
  constructor MkPercent
  value : Double
  0 prf : IsPercent value
```

That is, a value paired with a predicate on that value. The
predicate can be an explicit or implicit argument of any
quantity.

Reexports

importpublic Data.Refined

Definitions

dataAppVar : PArgn->Name->Type
  Proof that a constructor argument `arg` is a dependent type
on a second argument of name `name`, that is, `arg` is
of type `p nm` for some predicate `p`.

Totality: total
Visibility: public export
Constructors:
HereApp : (0_ : n1==n2=True) ->AppVar (PAppp (PVarn2)) n1
HereNamedApp : (0_ : n1==n2=True) ->AppVar (PNamedApppn3 (PVarn2)) n1
ThereApp : AppVarpn1->AppVar (PApppp2) n1
ThereNamedApp : AppVarpn1->AppVar (PNamedApppn2p2) n1
appVar : (nm : Name) -> (arg : PArgn) ->Maybe (AppVarargnm)
  Tests if `arg` is a dependent type on a value with name `nm`.

Totality: total
Visibility: public export
dataProofInfo : PiInfoTTImp->Type
  A proof (value of a predicate) in a refined type must be
an explicit or auto-implicit argument of that type.

Totality: total
Visibility: public export
Constructors:
PIAuto : ProofInfoAutoImplicit
PIExplicit : ProofInfoExplicitArg
proofInfo : (pi : PiInfoTTImp) ->Maybe (ProofInfopi)
  Tests if `pi` is explicit or auto-implicit

Totality: total
Visibility: public export
dataRefinedArgs : Vectm (ConArgn) ->Type
  Proof that the argument list of a data constructor
consists of erased implicits followed by a single
explicit value, followed by an explicit or auto-implicit
predicate on the value.

Totality: total
Visibility: public export
Constructors:
RArgs : ProofInfopi->AppVart2nm->RefinedArgs [CArg (Justnm) MWExplicitArgt1, CArgmncpit2]
RImplicit : RefinedArgsas->RefinedArgs (ParamArgixt::as)
refinedArgs : (as : Vectm (ConArgn)) ->Maybe (RefinedArgsas)
  Tests if the arguments of a data constructor are valid
arguments of a refined type.

Totality: total
Visibility: public export
proofType : VectnName-> (as : Vectm (ConArgn)) ->RefinedArgsas->TTImp
  Extracts the predicate from the constructor of a refined type.

Totality: total
Visibility: export
isErased : (as : Vectm (ConArgn)) ->RefinedArgsas->Bool
  Extracts the predicate from the constructor of a refined type.

Totality: total
Visibility: export
valType : VectnName-> (as : Vectm (ConArgn)) ->RefinedArgsas->TTImp
  Extracts the value type from the constructor of a refined type.

Totality: total
Visibility: export
valName : (as : Vectm (ConArgn)) ->RefinedArgsas->Name
  Extracts the field name from the constructor of a refined type

Totality: total
Visibility: export
appCon : TTImp-> (c : ParamConn) ->RefinedArgs (c.args) ->TTImp
  Applies the data constructor of a refinement type to a
refined value. We assume that a proof of validity of
the correct count is already in scope.

In case of an explicit proof argument, we pass the argument
by invoking `%search`, in case of an auto-implicit proof argument,
proof search will do this for us automatically.

Totality: total
Visibility: export
dataRefinedInfo : ParamTypeInfo->Type
  Proof that a data type is a refinement type: A data type with a single
data constructor taking an arbitrary number or erased implicit arguments,
a single explicit value argument of quantity "any" and an explict or
auto-implicit predicate on the value.

Totality: total
Visibility: public export
Constructor: 
RI : RefinedArgs (c.args) ->RefinedInfo (MkParamTypeInfotipns [c] s)
refinedInfo : (p : ParamTypeInfo) ->Res (RefinedInfop)
Totality: total
Visibility: export
refineClaim : Name-> (p : ParamTypeInfo) ->RefinedInfop->Decl
  Function for refining a value at runtime. This returns a `Maybe` of
the refinement type.

Totality: total
Visibility: export
refineDef : Name-> (p : ParamTypeInfo) ->RefinedInfop->Decl
Totality: total
Visibility: export
refineTL : Name-> (p : ParamTypeInfo) ->RefinedInfop->TopLevel
Totality: total
Visibility: export
fromIntTL : Visibility-> (p : ParamTypeInfo) ->RefinedInfop->TopLevel
Totality: total
Visibility: export
fromDblTL : Visibility-> (p : ParamTypeInfo) ->RefinedInfop->TopLevel
Totality: total
Visibility: export
fromStrTL : Visibility-> (p : ParamTypeInfo) ->RefinedInfop->TopLevel
Totality: total
Visibility: export
refineName : Nameda=>a->Name
Totality: total
Visibility: export
Refined : ListName->ParamTypeInfo->Res (ListTopLevel)
Totality: total
Visibility: export
RefinedIntegerVis : Visibility->ListName->ParamTypeInfo->Res (ListTopLevel)
Totality: total
Visibility: export
RefinedInteger : ListName->ParamTypeInfo->Res (ListTopLevel)
Totality: total
Visibility: export
RefinedDoubleVis : Visibility->ListName->ParamTypeInfo->Res (ListTopLevel)
Totality: total
Visibility: export
RefinedDouble : ListName->ParamTypeInfo->Res (ListTopLevel)
Totality: total
Visibility: export
RefinedStringVis : Visibility->ListName->ParamTypeInfo->Res (ListTopLevel)
Totality: total
Visibility: export
RefinedString : ListName->ParamTypeInfo->Res (ListTopLevel)
Totality: total
Visibility: export