Skip to content

0.3.0 - Better static checking and chaining

Compare
Choose a tag to compare
@maxveldink maxveldink released this 07 Jun 00:53
· 18 commits to main since this release
9b62232

[0.3.0] - 2023-06-06

Shoutout to @iMacTia for putting in most the work to make this release possible 🙏🏻

Added

  • Add .blank to create a Typed::Success with a nil payload or a Typed::Failure with a nil error.
  • Add #and_then to Typed::Result to allow chaining of results. See #14 for more details.

Changed

  • Breaking Make Typed::Success#Error and Typed::Failure#Payload fixed to T.noreturn. This allows to specify the other type_member only when using generics. See #8 for more details
  • Breaking Remove T.nilable from Payload and Error parameters in Typed::Success.new and Typed::Failure.new. Nilability will now need to be specified in the generic type. This also means that you'll need to use the new .blank instead of .new when you want to create a Typed::Success or Typed::Failure with a nil payload or error.
  • Breaking Change Typed::Success and Typed::Failure initialize arguments from keyword to positional.
  • Improve Typed::Success.new and Typed::Failure.new to make them generic methods and automatically infer the type of the payload and error arguments. See #8 for more details