Skip to content

Instantly share code, notes, and snippets.

@richyk1
Created February 27, 2020 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richyk1/490e05dabb325fb8f60a82bef842901c to your computer and use it in GitHub Desktop.
Save richyk1/490e05dabb325fb8f60a82bef842901c to your computer and use it in GitHub Desktop.
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