Open emil14 opened 2 weeks ago
match
In Rust match
statement is used to handle Option
and Result
(it also have unwrap
macro which causes panic). It's possible to imagine that with Maybe
is used with match
statement (will work same for lists):
match v[k] {
some -> println
none -> panic
}
maybe
for something that is not IO-specific, while it was stated before that for internal logic outports must be used (but maybe this is good case for maybe too?)Result
but only Maybe
it might be not clear for folks with Rust/Haskell/etc background why emptiness handling is different than error handlingRelated to #747 #726 #751 #756
v[k] {
some ->
match ->
}
I don't like this because numbers of reasons
maybe
type, regardless of whether this union or base type, is more universal - e.g. we can pass it to other components
Problem
At
andGet
components are used for accessing list element and dict value respectfully. Here's how it looks (example with dict):This is cumbersome compared to other languages. Can we introduce syntax sugar for this?
Proposal -
v[k|i]
syntaxGet/At
sendMaybe
instead of having 2 outports