mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-25 09:17:27 +03:00
38 lines
644 B
Plaintext
38 lines
644 B
Plaintext
|
|
type Foo a = Foo a
|
|
|
|
(+) = (UInt64.+)
|
|
|
|
-- The type 'a is sugar for `() -> a`.
|
|
-- The term 'a is sugar for `() -> a`.
|
|
-- !a forces a delayed expression (equivalent to `a()`)
|
|
|
|
woot : 'UInt64
|
|
woot = '42
|
|
|
|
-- A 'a can also be created by prefixing `let` with a '
|
|
woot2 : 'UInt64
|
|
woot2 = 'let
|
|
x = 1
|
|
y = 2
|
|
x + y
|
|
|
|
-- ' has higher precedence than -> in type signatures
|
|
-- and a lower precedence than type application
|
|
woot3 : 'UInt64 -> UInt64
|
|
woot3 x = !x + 1
|
|
|
|
woot4 : ∀ a . 'Foo a -> Foo a
|
|
woot4 foo = !foo
|
|
|
|
woot4-usage = woot4 '(Foo.Foo 19)
|
|
|
|
woot4-usage2 =
|
|
foo = 'let
|
|
x : UInt64
|
|
x = 99
|
|
Foo.Foo (x + x)
|
|
woot4 foo
|
|
|
|
woot4-usage2
|