coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Andrew Kennedy <akenn AT microsoft.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: [Coq-Club] Printing strings with newlines inside Coq
- Date: Wed, 27 Mar 2013 09:31:39 +0000
- Accept-language: en-GB, en-US
Hello
I have a seemingly simple problem: I want to pretty-print a large term inside Coq, simply by writing a function
Welcome to Coq 8.4pl1 (January 2013)
Coq < Require Import String. [Loading ML file z_syntax_plugin.cmxs ... done] [Loading ML file quote_plugin.cmxs ... done] [Loading ML file newring_plugin.cmxs ... done] [Loading ML file ascii_syntax_plugin.cmxs ... done] [Loading ML file string_syntax_plugin.cmxs ... done]
Coq < Open Scope string_scope.
Coq < Example s := "this is one line\n". s is defined
Coq < Example ss := s++s++s++s++s++s++s. ss is defined
Coq < Compute ss. = "this is one line\nthis is one line\nthis is one line\nthis is one line\n this is one line\nthis is one line\nthis is one line\n" : string
I want a way of *actually* *printing* the darn thing. Is there a way?
(Yes, I have considered simply using Notations for my Tm type, with format specifiers that incorporate line breaks, etc. But sometimes it’s just easier to write a function into string, as one would do in ML or Haskell.)
Cheers Andrew. |
- [Coq-Club] Printing strings with newlines inside Coq, Andrew Kennedy, 03/27/2013
- Re: [Coq-Club] Printing strings with newlines inside Coq, Laurent Théry, 03/27/2013
- RE: [Coq-Club] Printing strings with newlines inside Coq, Andrew Kennedy, 03/27/2013
- Re: [Coq-Club] Printing strings with newlines inside Coq, AUGER Cédric, 03/27/2013
- Re: [Coq-Club] Printing strings with newlines inside Coq, Maxime Dénès, 03/27/2013
- RE: [Coq-Club] Printing strings with newlines inside Coq, Andrew Kennedy, 03/27/2013
- Re: [Coq-Club] Printing strings with newlines inside Coq, AUGER Cédric, 03/27/2013
- Re: [Coq-Club] Printing strings with newlines inside Coq, Laurent Théry, 03/27/2013
Archive powered by MHonArc 2.6.18.