From b2dc3a9199369af04cf3ee9db0d1ebb5576a594b Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Tue, 30 Apr 2013 13:38:02 -0400 Subject: Forum: Rename “asker” to “author” MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- forum/asker.ur | 26 -------------------------- forum/asker.urs | 17 ----------------- forum/author.ur | 26 ++++++++++++++++++++++++++ forum/author.urs | 17 +++++++++++++++++ forum/forum.ur | 12 ++++++------ forum/lib.urp | 2 +- 6 files changed, 50 insertions(+), 50 deletions(-) delete mode 100644 forum/asker.ur delete mode 100644 forum/asker.urs create mode 100644 forum/author.ur create mode 100644 forum/author.urs diff --git a/forum/asker.ur b/forum/asker.ur deleted file mode 100644 index 947f20c..0000000 --- a/forum/asker.ur +++ /dev/null @@ -1,26 +0,0 @@ -type asker = option string - -val eq_asker = Option.eq - -val show_asker = - mkShow ( - fn nameOpt => - case nameOpt of - None => "Anonymous" - | Some nam => nam - ) - -val read_asker = - let fun parse text = - case text of - "Anonymous" => None - | nam => Some nam - in - mkRead parse (compose Some parse) - end - -val sql_asker = sql_option_prim - -val anonymous = None - -val namedAsker = Some diff --git a/forum/asker.urs b/forum/asker.urs deleted file mode 100644 index 99be711..0000000 --- a/forum/asker.urs +++ /dev/null @@ -1,17 +0,0 @@ -type asker - -val anonymous : asker -val namedAsker : string -> asker - - -(********************************* Instances *********************************) - -val eq_asker : eq asker - -val show_asker : show asker - -(* 'read' producing an 'asker' is guaranteed to never fail, so you can use -'readError' with impunity. *) -val read_asker : read asker - -val sql_asker : sql_injectable asker 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 diff --git a/forum/author.urs b/forum/author.urs new file mode 100644 index 0000000..619aced --- /dev/null +++ b/forum/author.urs @@ -0,0 +1,17 @@ +type author + +val anonymous : author +val namedAuthor : string -> author + + +(********************************* Instances *********************************) + +val eq_author : eq author + +val show_author : show author + +(* 'read' producing an 'author' is guaranteed to never fail, so you can use +'readError' with impunity. *) +val read_author : read author + +val sql_author : sql_injectable author diff --git a/forum/forum.ur b/forum/forum.ur index db33f8d..e8a4be5 100644 --- a/forum/forum.ur +++ b/forum/forum.ur @@ -21,7 +21,7 @@ functor Make(Template : sig end) = struct open Styles -open Asker +open Author style questionList style questionMetadata @@ -31,7 +31,7 @@ style questionEntryBody table question : { Id : int, Title : string, Body : string, - Asker : asker + Author : author } PRIMARY KEY Id sequence questionIdS @@ -44,7 +44,7 @@ fun prettyPrintQuestion row : xbody =
  • {[row.Question.Title]}

    {[row.Question.Body]} - Asked by {[row.Question.Asker]} + Asked by {[row.Question.Author]}
  • @@ -83,7 +83,7 @@ fun main () : transaction page =