 }
 
 
-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

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

public enum Token : Equatable {
  case whitespace
  case integerLiteral(Int)

  public static func ==(lhs: Token, rhs: Token) -> Bool {
    switch (lhs, rhs) {
      case (.whitespace, .whitespace): return true
      case let (.integerLiteral(leftVal), .integerLiteral(rightVal)):
        return leftVal == rightVal
      default:
        return false
    }
  }
}

public func whitespace(_ source: [Character]) -> (Token, [Character])? {
  let parser = map(char(" ")) { _ in Token.whitespace }
  return parser(source)
}


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