Skip to Content.
Sympa Menu

coq-club - [Coq-Club] Haskell Extraction

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] Haskell Extraction


chronological Thread 
  • From: Trevor Elliott <awesomelyawesome AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: [Coq-Club] Haskell Extraction
  • Date: Mon, 11 Apr 2011 13:46:10 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=R0AFKdaVPDvNXb0btEm7RYM5OV8Ss4g0j2CuomfVSLLDzdfpd0EVitIefxSOrZ5wSE 3iP9qLcX/z3koqEz8siRXHFw2p1Ju/FhedthnPtBtBjVIBZui9ej6rrC33D22HYNLeWr j2E8JzDY2v8g4S/Eivaa8mUwtFAXOqynKiZZQ=

Hi Everyone,

While playing around with extraction, I noticed a possible
inconsistency in the way that Coq treats extraction targets.  For
example, when extracting this implementation of factorial:

> Fixpoint fact_body (a n : nat) : nat :=
>   match n with
>     | 0   => a
>     | S m => fact_body (a*n) m
>   end.
> Definition fact : nat -> nat := fact_body 1.

Coq will produce very efficient OCaml, when ExtrOcamlNatInt is
imported, but inefficient Haskell or Scheme; mult and plus are
translated to the OCaml (*) and (+) operators.  Initially, I thought
that this was due to a lack of a set of analogous ExtrHaskell* and
ExtrScheme* modules in plugins/extraction, but producing my own
version of ExtrOcamlNatInt for Haskell yielded no change in the
extracted code.

Is this a limitation of the extraction plugin, or am I missing
something when extracting Haskell?

Thanks!

--trevor



Archive powered by MhonArc 2.6.16.

Top of Page