unison/unison-src/tests/suffix-resolve.u

24 lines
513 B
Plaintext

-- This file shows that any unique suffix can be used to refer
-- to a definition.
-- no imports needed here, even though FQN is builtin.Int
foo : Int
foo = +1
-- no imports needed here, even though FQNs are Optional.{None,Some}
ex1 = cases
None -> 0
Some a -> a + 1
-- you can still use the FQN
ex2 = cases
Optional.None -> 99
Optional.Some _ -> 0
ex3 = List.at 0 [ 1, 2, 3, 4 ]
-- TDNR would have handled this one before, but TDNR can't do
-- type resolution or pattern resolution
zoink = Some 42