-- | Reads string by given func and returns first result which has empty remainder (whole given
-- string was readed by reads func)
parse :: ReadS a -> String -> Maybe a
parse readsFunc str =
    let fullyParsed = filter (\ (_, rest) -> null rest) $ readsFunc str in
    if null fullyParsed then
        Nothing
    else
        Just $ fst $ head fullyParsed
parse :: ReadS a -> String -> Maybe a
parse readsFunc str =
    let fullyParsed = filter (\ (_, rest) -> null rest) $ readsFunc str in
    if null fullyParsed then
        Nothing
    else
        Just $ fst $ head fullyParsed
parse readsFunc str =
    let fullyParsed = filter (\ (_, rest) -> null rest) $ readsFunc str in
    if null fullyParsed then
        Nothing
    else
        Just $ fst $ head fullyParsed