Rename Imp test helper functions for consistency #4760
Open
Description
"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
- something like
get
orpartial
to indicate a runtime error.
So, the names I propose are:
- change
lookup[Reward|KeyPair|...]
to indicate a total function that returnsMaybe
- make partial functions prefixed with
get[Reward|KeyPair|..]
Originally posted by @lehins in #4756 (comment)