No title

Anonymous Coward 2018-03-06 11:50:03.742351 UTC

1registerUser1 ::[User] -> IO [User]
2registerUser1 userDb =
3 putStrLn "Enter the email " >> getLine >>= \email ->
4 putStrLn "Enter the name " >> getLine >>= \name ->
5 putStrLn "Enter the password " >> getLine >>= \password ->
6 putStrLn "Enter the postal code " >> getLine >>= \postalcode ->
7 let newuser = MkNewUser{nuserEmail = MkEmail email, nuserFullName = name, nuserPassword = password, nuserPostalCode = postalcode}
8 output = (registerUser newuser userDb)
9 in case output of
10 Left err -> putStrLn err >> registerUser1 userDb
11 Right udb -> pure udb