mirror of
https://github.com/unisonweb/unison.git
synced 2024-11-10 20:00:27 +03:00
23 lines
534 B
Plaintext
23 lines
534 B
Plaintext
use . Int -- imports `.Int` from root path and gives it the local name `Int`
|
|
|
|
-- This brings `None` into scope unqualified
|
|
use Optional None
|
|
|
|
-- '.' is optional, this brings `None` and `Some` into
|
|
-- scope unqualified
|
|
use Optional None Some
|
|
|
|
-- Can import operators this way also
|
|
-- no need to put them in parens
|
|
use Nat +
|
|
|
|
-- Later imports shadow earlier ones
|
|
use Nat - * /
|
|
use Nat drop *
|
|
use Nat drop
|
|
-- use Int + -- this would cause type error below!
|
|
|
|
> match Some (100 + 200 / 3 * 2) with
|
|
Optional.None -> 19
|
|
Some _ -> 20
|