From 7d189e95615b37106d504415ce21b8eec8710080 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sun, 21 Apr 2013 15:58:34 -0400 Subject: Forum: Functorize entry point --- forum/forum.ur | 24 ++++++++++++++++-------- forum/forum.urs | 8 +++++++- main.ur | 18 ++++++++++-------- 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/forum/forum.ur b/forum/forum.ur index f680ec4..8cb11da 100644 --- a/forum/forum.ur +++ b/forum/forum.ur @@ -16,13 +16,21 @@ details. You should have received a copy of the GNU Affero General Public License along with 6.947. If not, see . *) +functor Make(Template : sig + val generic : option string -> xbody -> page +end) = struct + open Styles -fun main () : xbody = - -
-

- Coming soon! -

-
-
+fun main () : transaction page = + return ( + Template.generic (Some "Forum") +
+

+ Coming soon! +

+
+
+ ) + +end diff --git a/forum/forum.urs b/forum/forum.urs index 1dad9a7..bf25c4f 100644 --- a/forum/forum.urs +++ b/forum/forum.urs @@ -16,4 +16,10 @@ details. You should have received a copy of the GNU Affero General Public License along with 6.947. If not, see . *) -val main : unit -> xbody +functor Make(Template : sig + val generic : option string -> xbody -> page +end) : sig + +val main : unit -> transaction page + +end diff --git a/main.ur b/main.ur index 7fe5845..a64254b 100644 --- a/main.ur +++ b/main.ur @@ -18,6 +18,16 @@ with 6.947. If not, see . *) open Styles +structure Forum = Forum.Make(struct + fun generic (pageName : option string) (content : xbody) : page = + Template.generic pageName + {Menu.header (make [#Forum] ())} + {content} + + end) + +val forum = Forum.main + fun main () = return (Template.generic None {Menu.header (make [#Main] ())} @@ -29,11 +39,3 @@ fun main () =

) - -and forum () = forumWorker Forum.main -and forumWorker (f : unit -> xbody) = - return (Template.generic (Some "Forum") - {Menu.header (make [#Forum] ())} - {f ()} - ) - -- cgit v1.2.3