let f ?bio request = % begin match Dream.session "nick" request with % | None -> not logged in % | Some nick -> %begin match bio with % | None -> % let bio = match User.get_bio nick with % | Ok bio -> bio % | Error e -> e %in <%s Format.sprintf "Hello %s !" nick %> <%s! Dream.form_tag ~action:"/profile" request %>
Who are you?
% | Some bio -> % begin match User.update_bio bio nick with % | Ok () -> Bio updated ! % | Error e -> <%s e %> % end; % end; %end;