unison/unison-src/test1.u

18 lines
342 B
Plaintext

type Optional a = None | Some a
Optional.isEmpty : ∀ a . Optional a -> Boolean
Optional.isEmpty o = case o of
Optional.None -> true
Optional.Some _ -> false
increment x = x +_UInt64 1
(|>) : forall a b . a -> (a -> b) -> b
a |> f = f a
Stream.from-int64 -3
|> Stream.take 10
|> Stream.fold-left +0 (+_Int64)
|> Optional.Some