diff options
| author | Pierre Letouzey | 2015-06-22 14:53:31 +0200 |
|---|---|---|
| committer | Pierre Letouzey | 2015-06-22 14:53:31 +0200 |
| commit | 29fcfc4f8bc1bfbdfbae0c07850aed65f6c3eb04 (patch) | |
| tree | 1e2edfae22c9f90ae4eceb8cf081df88a98b981e /plugins/extraction/ExtrHaskellNatInteger.v | |
| parent | 6bec099f8487b9d3ec5c44079cf69d3474c73b91 (diff) | |
| parent | 4b6b4d8cdd12902d166504ec3d96ca94705d81f6 (diff) | |
Merge branch 'v8.5' into trunk
Diffstat (limited to 'plugins/extraction/ExtrHaskellNatInteger.v')
| -rw-r--r-- | plugins/extraction/ExtrHaskellNatInteger.v | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/extraction/ExtrHaskellNatInteger.v b/plugins/extraction/ExtrHaskellNatInteger.v new file mode 100644 index 0000000000..038f0ed817 --- /dev/null +++ b/plugins/extraction/ExtrHaskellNatInteger.v @@ -0,0 +1,13 @@ +(** Extraction of [nat] into Haskell's [Integer] *) + +Require Import Arith. +Require Import ExtrHaskellNatNum. + +(** + * Disclaimer: trying to obtain efficient certified programs + * by extracting [nat] into [Integer] isn't necessarily a good idea. + * See comments in [ExtrOcamlNatInt.v]. +*) + +Extract Inductive nat => "Prelude.Integer" [ "0" "Prelude.succ" ] + "(\fO fS n -> if n Prelude.== 0 then fO () else fS (n Prelude.- 1))". |
