aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/extraction/haskell.ml
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-03-07 15:37:51 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-03-07 15:37:51 +0000
commit2d0293367d13ac8ef8c337ba1dd0085f83dc501b (patch)
tree536ce1b2bb5adb54cc49350a2f7555d61ae289f3 /plugins/extraction/haskell.ml
parent695bf462bba223c8870634bac7cb149ffb0b28b6 (diff)
Extraction: avoid printing unused mutual fix components (fix #2477)
This happens for instance when the main component of the fixpoint block has been provided via Extract Constant git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13889 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'plugins/extraction/haskell.ml')
-rw-r--r--plugins/extraction/haskell.ml13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/extraction/haskell.ml b/plugins/extraction/haskell.ml
index 6cad5d294..ef8a1f9b4 100644
--- a/plugins/extraction/haskell.ml
+++ b/plugins/extraction/haskell.ml
@@ -312,10 +312,17 @@ let pp_decl = function
in
prvecti
(fun i r ->
- if is_inline_custom r then mt ()
+ let void = is_inline_custom r ||
+ (not (is_custom r) && defs.(i) = MLexn "UNUSED")
+ in
+ if void then mt ()
else
- names.(i) ++ str " :: " ++ pp_type false [] typs.(i) ++ fnl ()
- ++ pp_function (empty_env ()) names.(i) defs.(i) ++ fnl2 ())
+ names.(i) ++ str " :: " ++ pp_type false [] typs.(i) ++ fnl () ++
+ (if is_custom r then
+ (names.(i) ++ str " = " ++ str (find_custom r))
+ else
+ (pp_function (empty_env ()) names.(i) defs.(i)))
+ ++ fnl2 ())
rv
| Dterm (r, a, t) ->
if is_inline_custom r then mt ()