Skip to content

Instantly share code, notes, and snippets.

@saml
Created January 12, 2016 20:42
Show Gist options
  • Save saml/892ade43c7b431f26322 to your computer and use it in GitHub Desktop.
Save saml/892ade43c7b431f26322 to your computer and use it in GitHub Desktop.
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