 }
 
 
-public func integerLiteral(_ source: [Character]) -> (Token, [Character])? {
+public func integerLiteral(_ source: [Character]) -> (Int, [Character])? {
   let intParser = (char("+") | char("-"))*? ~ rep1(digit)
 
   return intParser(source).flatMap { result in

    default: break
    }
    return Int(String(result.0.1)).map { intVal in
      (.integerLiteral(intVal * sign), result.1)
    }
  }
}

//
// typealias LexicalParser = HeterogeneousParser<Character, String>

public func whitespace<T>(token: T) -> HeterogeneousParser<Character, T> {
  let parser = whitespaceWithContent ^^ { _ in token }
  return { source in
    parser(source)
  }
}

public func whitespaceWithContent(_ source: [Character]) -> (String, [Character])? {
  let parser = char(" ") | char("\n") | char("\t")
  return parser(source)
}

