Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Example of functor type

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Example of functor type


chronological Thread 
  • From: Pierre Casteran <pierre.casteran AT labri.fr>
  • To: coq-club AT pauillac.inria.fr
  • Subject: [Coq-Club] Example of functor type
  • Date: Fri, 18 Feb 2005 09:05:56 +0100
  • List-archive: <http://pauillac.inria.fr/pipermail/coq-club/>

Hello,

 I am looking for a (simple if possible) example of a functor type
(as created with "Module Type ident module_bindings := module_type")
and how to apply this functor.

By the way, it is possible that the following is a bad use of
functor types :-(


Pierre



Module Type S1.
 Parameter t : Set.
 Parameter eq_dec : forall a b:t, {a=b}+{a<>b}.
End S1.

Module Type S2 (M:S1).
 Definition t := M.t.
 Definition eq_dec := M.eq_dec.
 Parameter eq_dec_prop : forall a b:t, a = b \/ a <> b.
End S2.

(*
 all the following commands raise errors.


Module F1_2 (M:S1) : S2.

Module F1_2 (M:S1) : S2 with Module M:=M.

Module F1_2 (M:S1) : S2 M.

Module F1_2 (M:S1) : (S2 M).

*)


-- 
Pierre Casteran
(+33) 540006931

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




Archive powered by MhonArc 2.6.16.

Top of Page