Created
February 27, 2020 14:56
-
-
Save richyk1/490e05dabb325fb8f60a82bef842901c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
personExists :: Person -> Bool | |
personExists (Person id name lastname password) = do | |
let | |
database = "database.txt" | |
contents <- readFile database | |
if (contents > 0) then do | |
let | |
(x:xs) = splitOn "\n" contents | |
person = id ++ ";" ++ name ++ ";" ++ lastname ++ ";" ++ password | |
existsInList person [] = False | |
existsInList person (x:xs) | person == x = True | |
| otherwise = existsInList person xs | |
-- issue is on this "in" ; Storage.hs:36:9: error: parse error on input `in' | |
in existsInList person (x:xs) | |
else False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment