userUpdateForm :: Monad m => Maybe User -> Form Text m UserUpdate
userUpdateForm mu = UserUpdate
    <$> "name" .: check "name cannot be empty" notEmpty (text $ userName <$> mu)
    <*> "email" .: check "email cannot be empty" notEmpty (text $ userEmail <$> mu)
    <*> "password" .: check "passwords must match" mustmatch passwordUpdateForm
        where notEmpty = not . T.null
              mustmatch (a,b) = a == b
userUpdateForm :: Monad m => Maybe User -> Form Text m UserUpdate
userUpdateForm mu = UserUpdate
    <$> "name" .: check "name cannot be empty" notEmpty (text $ userName <$> mu)
    <*> "email" .: check "email cannot be empty" notEmpty (text $ userEmail <$> mu)
    <*> "password" .: check "passwords must match" mustmatch passwordUpdateForm
        where notEmpty = not . T.null
              mustmatch (a,b) = a == b
userUpdateForm mu = UserUpdate
    <$> "name" .: check "name cannot be empty" notEmpty (text $ userName <$> mu)
    <*> "email" .: check "email cannot be empty" notEmpty (text $ userEmail <$> mu)
    <*> "password" .: check "passwords must match" mustmatch passwordUpdateForm
        where notEmpty = not . T.null
              mustmatch (a,b) = a == b