Hi,
During the AoC, I found myself needing the rusty Option<T>
. Could it be something interesting to be added to builtins?
Here's my current interface:
Option some : [Some some, None]
isSome : Option some -> Bool
isNone : Option some -> Bool
contains : Option a, a -> Bool
withDefault : Option a, a -> a
map : Option a, (a -> b) -> Option b
mapNone : Option a, a -> Option a
try : Option a, (a -> Option b) -> Option b
onNone : Option a, Option a -> Option a
we are well-aware of this type :smile:. but so far, it's been nicer to use Result
with some custon well-named reason why the value is absent
Folkert de Vries said:
we are well-aware of this type :smile:.
Maybe ... :wink:
We also answer this in detail in the FAQ.
:100: Thanks @Anton, sorry, it totally slipped my mind! I often make the mistake to read full docs before trying things and so do not understand every aspects of what I read that it doesn't stay well in memory. I should read again the FAQ / doc now I have a better knowledge of the language!
No need to apologize :)
Last updated: Jul 06 2025 at 12:14 UTC