{- ------------------------------
   Parsing Binders
   ------------------------------ -}

-- due to the definition of "identState" in fullErrorDef,
-- this is the only way that an underscore can enter our system,
-- and thus there is no chance of it being misused as a variable elsewhere
parseVarBind = do var <- identifier <|> symbol "_"
                  symbol ":"
                  ty <- parseType
                  let binding = VarBind ty
                  updateState $ appendBinding var binding
                  return $ TmBind var binding
parseVarBind = do var <- identifier <|> symbol "_"
                  symbol ":"
                  ty <- parseType
                  let binding = VarBind ty
                  updateState $ appendBinding var binding
                  return $ TmBind var binding
parseVarBind = do var <- identifier <|> symbol "_"
                  symbol ":"
                  ty <- parseType
                  let binding = VarBind ty
                  updateState $ appendBinding var binding
                  return $ TmBind var binding