[MLton-commit] r5270

Vesa Karvonen vesak at mlton.org
Mon Feb 19 23:37:28 PST 2007


Working on concept signatures.
----------------------------------------------------------------------

A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig

----------------------------------------------------------------------

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig	2007-02-19 22:58:14 UTC (rev 5269)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig	2007-02-20 07:37:20 UTC (rev 5270)
@@ -0,0 +1,34 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+(**
+ * Stringables can be embedded into strings.  The string representation is
+ * usually human readable.
+ *)
+signature STRINGABLE = sig
+   type stringable
+
+   val embString : (stringable, String.t) Emb.t
+   (**
+    * An embedding of stringables into strings.  It is always equivalent
+    * to {(toString, fromString)}.
+    *)
+
+   val fromString : String.t -> stringable Option.t
+   (**
+    * Returns {SOME v} if a stringable {v} can be parsed from a prefix of
+    * the given string, ignoring initial whitespace; {NONE} is returned
+    * otherwise.  May raise an exception if a stringable can be parsed
+    * from the prefix, but the value is not representable as a stringable
+    * (e.g. causes {Overflow}).
+    *)
+
+   val toString : stringable -> String.t
+   (**
+    * Returns a string containing a representation of the given
+    * stringable.
+    *)
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig
___________________________________________________________________
Name: svn:eol-style
   + native




More information about the MLton-commit mailing list