formHandler :: (BH.ToMarkup error, Show a) => 
               TR.Form (ServerPartT IO) [Input] error BH.Html proof a -> 
               ServerPart Response 
formHandler form = CM.msum 
    [ do method GET 
         html <- TR.viewForm "user" form 
         appTemplate "Sample Form" $ blazeForm html 
    , do method POST 
         r <- TR.eitherForm environment "user" form 
         case r of 
            (Right a) -> appTemplate "Form result" $ BH.toHtml $ show a 
            (Left view) -> appTemplate "Form result" $ blazeForm view 
    ]
formHandler :: (BH.ToMarkup error, Show a) => 
               TR.Form (ServerPartT IO) [Input] error BH.Html proof a -> 
               ServerPart Response
formHandler form = CM.msum 
    [ do method GET 
         html <- TR.viewForm "user" form 
         appTemplate "Sample Form" $ blazeForm html 
    , do method POST 
         r <- TR.eitherForm environment "user" form 
         case r of 
            (Right a) -> appTemplate "Form result" $ BH.toHtml $ show a 
            (Left view) -> appTemplate "Form result" $ blazeForm view 
    ]
formHandler form = CM.msum 
    [ do method GET 
         html <- TR.viewForm "user" form 
         appTemplate "Sample Form" $ blazeForm html 
    , do method POST 
         r <- TR.eitherForm environment "user" form 
         case r of 
            (Right a) -> appTemplate "Form result" $ BH.toHtml $ show a 
            (Left view) -> appTemplate "Form result" $ blazeForm view 
    ]