Skip to content

tuura/selective-theory-coq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a Coq formalisation of Selective Applicative Functors, containing proof of Functor, Applicative and Selective laws for a number of instances.

Build instructions

To play with the definitions and proofs, you'll need to have the Coq proof assistant installed. You will also need the Equations plug-in. The proofs can be checked by running make.

Free Rigid Selective Functors

The most interesting thing in this repo is the data type formalising free rigid selective functors

Inductive Select (F : Type -> Type) (A : Type) :=
    Pure   : A -> Select F A
  | MkSelect : forall B, Select F (B + A) -> F (B -> A) -> Select F A.

and the proofs it is a lawful instance of Functor, Applicative and (proof to be completed) Selective.

Free Theorems

The proofs for free rigid selective functors rely no three free theorems which hold by parametricity and admitted as axioms. See SelectiveParametricity for details. We also reformulate these theorems for the data constructor MkSelect

Acknowledgements

We borrowed a number of definitions and tricks from @jwiegley's coq-haskell library.