From 3fd0b8ad700bd77aabdd3f3f33b13ba5e93d8bc8 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Wed, 17 Aug 2016 16:14:35 +0200 Subject: Revert "CLEANUP: removing the definition of the "Context.Rel.Declaration.to_tuple" function" This reverts commit 4b24bb7d3b770592015c264001b9aed9fe95c200. While the of_tuple function is clearly dubious and mostly used for compatiblity reasons, and thus had to be removed, I think that the to_tuple function is still useful as it allows to access each component of the declaration piecewise. Without it, some codes tend to get cluttered with useless projections here and there. --- kernel/context.ml | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'kernel/context.ml') diff --git a/kernel/context.ml b/kernel/context.ml index ca084b682..269bf2143 100644 --- a/kernel/context.ml +++ b/kernel/context.ml @@ -142,6 +142,11 @@ struct match decl with | LocalAssum (n,ty) -> f ty acc | LocalDef (n,v,ty) -> f ty (f v acc) + + let to_tuple = function + | LocalAssum (na, ty) -> na, None, ty + | LocalDef (na, v, ty) -> na, Some v, ty + end (** Rel-context is represented as a list of declarations. -- cgit v1.2.3