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
"unsafe" is a bad prefix, because unsafe in Haskell usually describes things that violate some invariant and lead to dangerous situations like segfaults or other unpredictable behavior. Functions that throw errors when something goes wrong are called partial instead of unsafe. Considering that these function don't deal with anything unsafe there names should follow the common convention that is used in other libraries:
lookup to mean a total function that returns a Maybe
try to mean a recovery from failure that returns an Either
something like get or partial to indicate a runtime error.
So, the names I propose are:
change lookup[Reward|KeyPair|...] to indicate a total function that returns Maybe
make partial functions prefixed with get[Reward|KeyPair|..]
"unsafe" is a bad prefix, because unsafe in Haskell usually describes things that violate some invariant and lead to dangerous situations like segfaults or other unpredictable behavior. Functions that throw errors when something goes wrong are called partial instead of unsafe. Considering that these function don't deal with anything unsafe there names should follow the common convention that is used in other libraries:
lookup
to mean a total function that returns aMaybe
try
to mean a recovery from failure that returns anEither
get
orpartial
to indicate a runtime error.So, the names I propose are:
lookup[Reward|KeyPair|...]
to indicate a total function that returnsMaybe
get[Reward|KeyPair|..]
Originally posted by @lehins in #4756 (comment)
The text was updated successfully, but these errors were encountered: