*Main> :t elem elem :: (Foldable t, Eq a) => a -> t a -> Bool *Main> parse "abc" (noneOf ";,.") *Main> parse "abc" (noneOf ";,.") Just ('a',"bc") *Main> parse "abc" (noneOf ";,.a") Nothing *Main> parse "aaaaaaaaaaaaaabbbbbb" (many $ char 'a') Just ("aaaaaaaaaaaaaa","bbbbbb") *Main> parse "aaaaaaaaaaaaaabbbbbb" (many $ char 'b') Just ("","aaaaaaaaaaaaaabbbbbb") *Main> parse "aaaaaaaaaaaaaabbbbbb" (many1 $ char 'b') Nothing *Main> parse "aaaaaaaaaaaaaabbbbbb" (many1 $ char 'a') Just ("aaaaaaaaaaaaaa","bbbbbb") *Main> parse "" (many $ char 'a') Just ("","") *Main> parse "" (many1 $ char 'a') Nothing *Main> parse "a,b,c" (char 'a' `sepby` char ',') Just ("a",",b,c") *Main> parse "a,a,b,c" (char "abc" `sepby` char ',') Just ("aa",",b,c") *Main> parse "a,a,b,c" (char "abc" `sepby` char ',') *Main> parse "a,a,b,c" (string "abc" `sepby` char ',') Just ([],"a,a,b,c") *Main> parse "abc,abc,b,c" (string "abc" `sepby` char ',') Just (["abc","abc"],",b,c") *Main> parse "ab,b,c" (string "abc" `sepby1` char ',') Nothing *Main> parse "ab,b,c" (string "abc" `sepby` char ',') Just ([],"ab,b,c") *Main> :r [1 of 1] Compiling Main ( lec14.hs, interpreted ) lec14.hs:130:17: error: • Couldn't match type ‘()’ with ‘Char’ Expected type: Parser Char Actual type: Parser () • In the second argument of ‘(<|>)’, namely ‘eof’ In a stmt of a 'do' block: char '\n' <|> eof In the expression: do cs <- content `sepby1` comma char '\n' <|> eof return cs | 130 | char '\n' <|> eof | ^^^ Failed, no modules loaded. *Main> parse "a,b,c\n d,e \n a, b" csv Just ([["a","b","c"],[" d","e "],[" a"," b"]],"")