Created
January 12, 2016 20:42
-
-
Save saml/892ade43c7b431f26322 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let a = 1 // number, comment | |
let b int64 = 2 // wow type. | |
let c = "hello" | |
func f(a, b) = | |
a + b | |
func g(x int) int = { | |
c + " world!" // side effect | |
x + 1 | |
} | |
type T | |
struct A(x int, y float) | | |
struct B(z float) | | |
float | |
func h(t T) = switch t { | |
case A(x, y) -> y + 1.0 | |
case B(z) -> z + 2.0 | |
case x -> x | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment