parseTupleFile :: String -> Either Error [[Assert]]
parseTupleFile f = do
    ls <- lexFile f
    let bs = filter (not . null) . map fixBlock . blocks $ ls
    mapM (mapM parseTuple) bs
  where
    blocks :: [[L]] -> [[[L]]]
    blocks [] = []
    blocks xs = let (x, r) = span (not . null) xs in x : blocks (st r)
      where
        st [] = []
        st (_:a) = a
    fixBlock :: [[L]] -> [[L]]
    fixBlock = nonEmpty . map removeComments
    nonEmpty = filter (not . null)
parseTupleFile :: String -> Either Error [[Assert]]
parseTupleFile f = do
    ls <- lexFile f
    let bs = filter (not . null) . map fixBlock . blocks $ ls
    mapM (mapM parseTuple) bs
  where
    blocks :: [[L]] -> [[[L]]]
    blocks [] = []
    blocks xs = let (x, r) = span (not . null) xs in x : blocks (st r)
      where
        st [] = []
        st (_:a) = a
    fixBlock :: [[L]] -> [[L]]
    fixBlock = nonEmpty . map removeComments
    nonEmpty = filter (not . null)
parseTupleFile f = do
    ls <- lexFile f
    let bs = filter (not . null) . map fixBlock . blocks $ ls
    mapM (mapM parseTuple) bs
  where
    blocks :: [[L]] -> [[[L]]]
    blocks [] = []
    blocks xs = let (x, r) = span (not . null) xs in x : blocks (st r)
      where
        st [] = []
        st (_:a) = a
    fixBlock :: [[L]] -> [[L]]
    fixBlock = nonEmpty . map removeComments
    nonEmpty = filter (not . null)