rbi/dry-monads.rbi in dry-monads-sorbet-1.1.0.pre vs rbi/dry-monads.rbi in dry-monads-sorbet-1.1.0.pre.2
- old
+ new
@@ -1,11 +1,9 @@
-# typed: true
+# typed: strong
#
# dry-monads-1.3.1
#
-# Note: This file depends on dry/monads/sorbet to define generics.
-
module Dry
end
module Dry::Monads
def self.Result(error, **options); end
def self.[](*monads); end
@@ -38,13 +36,10 @@
def fmap2(*args); end
def fmap3(*args); end
end
class Dry::Monads::Maybe
extend T::Helpers
- extend T::Generic
- Elem = type_member
-
abstract!
sealed!
sig do
type_parameters(:New)
@@ -79,25 +74,18 @@
blk: T.nilable(T.proc.returns(T.type_parameter(:Error))))
.returns(Dry::Monads::Result[T.type_parameter(:out, :Error), Elem])
end
def to_result(val = nil, &blk); end
- sig {returns(T::Boolean)}
def failure?; end
def monad; end
-
- sig {returns(T::Boolean)}
def none?; end
def self.coerce(value); end
def self.lift(*args, &block); end
def self.pure(value = nil, &block); end
def self.to_proc; end
-
- sig {returns(T::Boolean)}
def some?; end
-
- sig {returns(T::Boolean)}
def success?; end
def to_maybe; end
def to_monad; end
include Dry::Monads::Transformer
end
@@ -164,13 +152,10 @@
def self.all(hash, trace = nil); end
def self.filter(hash); end
end
class Dry::Monads::Result
extend T::Helpers
- extend T::Generic
- FailureType = type_member
- SuccessType = type_member
abstract!
sealed!
sig do
type_parameters(:NewSuccessType)
@@ -208,11 +193,12 @@
sig {returns(FailureType)}
def failure; end
sig do
- params(blk: T.proc.params(arg0: FailureType).returns(Dry::Monads::Result[FailureType, SuccessType]))
- .returns(Dry::Monads::Result[FailureType, SuccessType])
+ type_parameters(:NewFailureType)
+ .params(blk: T.proc.params(arg0: FailureType).returns(Dry::Monads::Result[T.type_parameter(:out, :NewFailureType), SuccessType]))
+ .returns(Dry::Monads::Result[T.type_parameter(:out, :NewFailureType), SuccessType])
end
def or(&blk); end
def monad; end
def self.pure(value = nil, &block); end