Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Free monads and strict positivity

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Free monads and strict positivity


Chronological Thread 
  • From: John Wiegley <johnw AT newartisans.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Free monads and strict positivity
  • Date: Wed, 08 Oct 2014 02:49:02 -0500
  • Organization: New Artisans LLC

>>>>> Pierre-Evariste Dagand
>>>>> <pierre-evariste.dagand AT ens-cachan.org>
>>>>> writes:

> Now, to translate that paper, everywhere Conor is manipulating functors, you
> should work on 'Signatures'. Implementing such system in type theory is a
> Scottish cottage industry: you should many implementations north of the
> Border (perhaps starting with Brady's "Programming and Reasoning with
> Algebraic Effects and Dependent Types" and then harassing Stevan Andjelkovic
> -- Conor's student -- to first write and then publish his PhD thesis
> online).

Hi Pierre,

Thanks to your wonderful advice, I was able to implement the Kleene monad in
Coq and prove all the various laws regarding it.

Where I am having difficulties now is figuring out how to use signatures. For
example:

Definition FH' : (State → Type) → State → Type :=
((FilePath ::= Closed) :>>: (fun _ => State)) (* fOpen *)
:+: ((unit ::= Open) :>>: (option nat ::= Open)) (* fGetC *)
:+: ((unit ::= Open) :>>: (unit ::= Closed)). (* fClose *)

Definition FH : Signature State :=
{| Operations := fun st : State => State -> Type (* WRONG *)
; Arities := fun (st : State) ops => FH' ops st (* WRONG? *)
; Sorts := fun (st : State) ops ars => st |}. (* WRONG *)

Definition fOpen (p : FilePath) : (FH :* (const State)) Closed.
Proof.
apply Do.
apply {| op := ?
; ar := ?
; xx := @Ret _ _ _ (* ? *)
|}.
Abort.

Is the Signature over State, or would it be over HF' in this example? Or is
it something else altogether?

The current version of the code remains here:

https://github.com/jwiegley/coq-haskell/blob/master/Conor.v#L1113

Many thanks!
John



Archive powered by MHonArc 2.6.18.

Top of Page