S-expressions: Difference between revisions

m
Line 3,083:
atom s@('"' : _) =
fromMaybe (List []) (maybeRead ("String " <> s))
atom s = firstParse parses
headDef (List []) $
where
catMaybes $
firstParse (x : _) = x
parses = maybeRead
<$> ( fmap (<> (' ' : s)) ["Int", "Float"]
catMaybes $
<> ["Symbol \"" <> s <> "\""]
maybeRead
<$> ( fmap)
 
(<> (' ' : s))
headDef :: a -> [a] -> a
["Int", "Float"]
headDef d [] = d
<> ["Symbol \"" <> s <> "\""]
headDef _ (x : _) = )x
 
maybeRead :: String -> Maybe Val
9,655

edits