-- | Attempt to parse the given tree in SGF form.
--
-- Returns Nothing if the input wasn't valid SGF.
parseSgf :: Text -> Maybe SgfTree
parseSgf = either (const Nothing) Just . parseOnly tree
parseSgf :: Text -> Maybe SgfTree
parseSgf = either (const Nothing) Just . parseOnly tree
parseSgf = either (const Nothing) Just . parseOnly tree