Box.Result (box v0.15.1)
View SourceHelper function to deal with :ok/:error tuples
Summary
Functions
Apply another result function to a success result
Returns an error tuple
Creates a result from a boolean value
Returns {:ok, value} if the value is not nil, returns an error tuple if the given value is nil with error as second value
Log value using success or error function depending on the result
Maps a success value
Returns an ok tuple
Returns true if the result is an ok tuple
Applies a function on success result but without keeping the previous result
Extracts the value from a success tuple
Returns success value if success, fallbacks otherwise
Types
Functions
Apply another result function to a success result
Returns an error tuple
Creates a result from a boolean value
Returns {:ok, value} if the value is not nil, returns an error tuple if the given value is nil with error as second value
Log value using success or error function depending on the result
Maps a success value
Returns an ok tuple
Returns true if the result is an ok tuple
Applies a function on success result but without keeping the previous result
Extracts the value from a success tuple
Returns success value if success, fallbacks otherwise