News for hackers. Stuff that matters.
Re:Limitations of protocols in Swift by alexjarvis on Wednesday December 16, 2015 @06:18AM (#10743545)
And with associated values in enum types they behave in a similar way to case classes in Scala that extend a sealed trait.

For example I've been working on a Json library that stores everything in an enum (ADT):

  public enum JsValue {
    case JsString(String)
    case JsNumber(Double)
    case JsObject([String: JsValue])
    case JsArray([JsValue])
    case JsBoolean(Bool)
    case JsNull
  }

There are no comments on this comment yet.