Corner.Maybe (corner v0.1.2)

Define macro maybe/1.

maybe/1 can be used to replace with.

example

Example

import Corner.Maybe
maybe do
  {:ok, v} = a_function_return_tab_result() # {:ok|:error, any}
  # do work with v
else
  {:error, v} -> # error handler
end

Link to this section Summary

Functions

This is samilary as Eralng future of maybe.

Link to this section Functions

Link to this macro

maybe(do_block)

(macro)

This is samilary as Eralng future of maybe.

do_block can have a :else option.