unison/unison-src/tests/imports.u

21 lines
456 B
Plaintext

-- 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