mirror of
https://github.com/unisonweb/unison.git
synced 2024-10-04 21:57:25 +03:00
22 lines
520 B
Plaintext
22 lines
520 B
Plaintext
type Optional a = None | Some a
|
|
|
|
Optional.isEmpty : Optional a -> Boolean
|
|
Optional.isEmpty o = case o of
|
|
Optional.None -> true
|
|
Optional.Some _ -> false
|
|
|
|
increment x = x + 1
|
|
|
|
(|>) : forall a b . a -> (a -> b) -> b
|
|
a |> f = f a
|
|
|
|
Stream.from-int -3
|
|
|> Stream.take 10
|
|
|> Stream.fold-left +0 (Int.+)
|
|
|> Optional.Some
|
|
|
|
-- as of 3935b366383fe8184f96cfe714c31ca04234cf27,
|
|
-- complains about the Optional on line 1 being different
|
|
-- from the Optional on line 3.
|
|
-- Surprisingly, it typechecks if I comment out line 1.
|