I’ve been experimenting with adding Sorbet support to Dry::Monads::Result and Dry::Monads::Maybe. It works well, and allows for type declarations like:
sig { params(html: Nokogiri::HTML::DocumentFragment).returns(Dry::Monads::Result[OptimisationError, Nokogiri::HTML::DocumentFragment]) }
def optimise(html:)
...
end
So far I have a dry-monads.rbi
file and some code which monkey-patches the those two classes to support the generics syntax. I’m not intimately familiar with Sorbet and may not have written idiomatic code for it.
What would be the best way to get this functionality incorporated into dry-monads proper?