unison/unison-src/tests/imports.u
2023-02-27 11:13:09 -05:00

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