From 794719aadd55d760c0514f45c23b9cb450d92d9f Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Fri, 13 May 2011 20:28:54 -0700 Subject: [PATCH] add ToString instance for lists --- src/General.v | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/General.v b/src/General.v index db77f34..f97989d 100644 --- a/src/General.v +++ b/src/General.v @@ -469,6 +469,15 @@ Instance EqDecidableList {T:Type}(eqd:EqDecidable T) : EqDecidable (list T). apply eqd_dec. Defined. +Fixpoint listToString {T:Type}{tst:ToString T}(l:list T) : string := + match l with + | nil => "nil" + | a::b => (toString a) +++ "::" +++ listToString b + end. + +Instance ListToString {T:Type}{tst:ToString T} : ToString (list T) := + { toString := @listToString _ _ }. + (*******************************************************************************) (* Tree Flags *) -- 1.7.10.4