   */
   public static func decode(_ json: JSON) -> Decoded<Int> {
     switch json {
-    case let .number(n): return pure(n as Int)
+    case let .number(n): return pure(n.intValue)
     default: return .typeMismatch(expected: "Int", actual: json)
     }
   }

  */
  public static func decode(_ json: JSON) -> Decoded<Double> {
    switch json {
    case let .number(n): return pure(n as Double)
    default: return .typeMismatch(expected: "Double", actual: json)
    }
  }

  public static func decode(_ json: JSON) -> Decoded<Bool> {
    switch json {
    case let .bool(n): return pure(n)
    case let .number(n): return pure(n.boolValue)
    default: return .typeMismatch(expected: "Bool", actual: json)
    }
  }
