From 2d0293367d13ac8ef8c337ba1dd0085f83dc501b Mon Sep 17 00:00:00 2001 From: letouzey Date: Mon, 7 Mar 2011 15:37:51 +0000 Subject: 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 --- plugins/extraction/haskell.ml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'plugins/extraction/haskell.ml') 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 () -- cgit v1.2.3