(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// this is a playground | |
protocol Nat { | |
class func construct() -> Self | |
class func value() -> Int | |
} | |
struct Z : Nat { | |
static func construct() -> Z { | |
return Z() | |
} |
OBSOLETE PREFIXES | |
-xv-interpret-as // -xv- and -o- are old Opera prefixes for the Presto | |
-xv-phonemes // engine. Opera switched to the Blink engine with | |
-xv-voice-balance // version 15. The current version is 34. | |
-xv-voice-duration | |
-xv-voice-pitch | |
-xv-voice-pitch-range | |
-xv-voice-rate | |
-xv-voice-stress | |
-xv-voice-volume |
This blog post series has moved here.
You might also be interested in the 2016 version.
Tagged unions are a way of saying "this data is any one of these values", and the tag is a property that discriminates the values. It enables some really powerful type system features, like exhaustive checking and control flow analysis.
Tagged unions also go by the name of: tagged unions, discriminated unions, algebraic data types (ADTs), and sum types. Just to confuse matters.
In many functional languages this is a really common pattern, like Haskell, Elm, PureScript, and Scala. So much so, they have their own native syntax.
For example, in Elm we can define a tagged union representing an anonymous or named user with:
// elm