You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
}
Problems
It's not clear how exactly match statement must work - is this special form or common use-case? How will it play with other "forms" (if any)?
We have to use 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?)
If we end up not having Result but only Maybe it might be not clear for folks with Rust/Haskell/etc background why emptiness handling is different than error handling
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 outportsThe text was updated successfully, but these errors were encountered: