summaryrefslogtreecommitdiff
path: root/forum/author.ur
diff options
context:
space:
mode:
Diffstat (limited to 'forum/author.ur')
-rw-r--r--forum/author.ur26
1 files changed, 26 insertions, 0 deletions
diff --git a/forum/author.ur b/forum/author.ur
new file mode 100644
index 0000000..e0b1989
--- /dev/null
+++ b/forum/author.ur
@@ -0,0 +1,26 @@
+type author = option string
+
+val eq_author = Option.eq
+
+val show_author =
+ mkShow (
+ fn nameOpt =>
+ case nameOpt of
+ None => "Anonymous"
+ | Some nam => nam
+ )
+
+val read_author =
+ let fun parse text =
+ case text of
+ "Anonymous" => None
+ | nam => Some nam
+ in
+ mkRead parse (compose Some parse)
+ end
+
+val sql_author = sql_option_prim
+
+val anonymous = None
+
+val namedAuthor = Some