dry-monads-sorbet 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/rspec.yml +22 -0
- data/.gitignore +20 -0
- data/.reek.yml +32 -0
- data/.rspec +3 -0
- data/.rubocop.yml +66 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +25 -0
- data/LICENSE.txt +21 -0
- data/README.md +22 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/dry-monads-sorbet.gemspec +33 -0
- data/lib/dry/monads/sorbet.rb +15 -0
- data/lib/dry/monads/sorbet/version.rb +9 -0
- data/rbi/dry-monads.rbi +593 -0
- metadata +159 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1b05da9a054e5d4cdd5a1c633508c625d1747b09f91083c1dbe470ed40e3fa8e
|
4
|
+
data.tar.gz: 032e205d4a338bc7c63578f87ea2e519351c1afe86c9f81afa2e5e4e8e1c4d34
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 782efb30f148bef10ff3f6ee3377414198362503e8175392010f39c1847d25eee1cd4d8f5eee890aa1cb8bdc95a9d3abd8583131353dfa187e9ce41d5f8ac3f6
|
7
|
+
data.tar.gz: c1558b1848b5e5d09b3af4ba4bd81ffb615e6951e9f60e4a84240e1067fe79ad2c958baeb0e6f419b58e43a0c3f845de5183881335eda4f1ba70a57b33d69731
|
@@ -0,0 +1,22 @@
|
|
1
|
+
name: RSpec Test Suite
|
2
|
+
|
3
|
+
on: [push]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- name: Checkout branch
|
10
|
+
uses: actions/checkout@v1
|
11
|
+
- name: Set up Ruby
|
12
|
+
uses: actions/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: 2.5.5
|
15
|
+
- name: Install system packages
|
16
|
+
run: |
|
17
|
+
sudo apt-get install libsqlite3-dev
|
18
|
+
command -v bundler || gem install bundler
|
19
|
+
- name: Install gems
|
20
|
+
run: bundle install --jobs $(nproc) --retry 3
|
21
|
+
- name: Run RSpec test suite
|
22
|
+
run: bundle exec rspec spec
|
data/.gitignore
ADDED
data/.reek.yml
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
detectors:
|
3
|
+
IrresponsibleModule:
|
4
|
+
enabled: false
|
5
|
+
TooManyStatements:
|
6
|
+
enabled: true
|
7
|
+
max_statements: 10
|
8
|
+
NilCheck:
|
9
|
+
enabled: false
|
10
|
+
directories:
|
11
|
+
app/controllers:
|
12
|
+
NestedIterators:
|
13
|
+
max_allowed_nesting: 2
|
14
|
+
UnusedPrivateMethod:
|
15
|
+
enabled: false
|
16
|
+
app/helpers:
|
17
|
+
UtilityFunction:
|
18
|
+
enabled: false
|
19
|
+
exclude_paths:
|
20
|
+
- app/assets
|
21
|
+
- bin
|
22
|
+
- client/node_modules
|
23
|
+
- config
|
24
|
+
- coverage
|
25
|
+
- data
|
26
|
+
- db
|
27
|
+
- dw
|
28
|
+
- log
|
29
|
+
- phrase
|
30
|
+
- public
|
31
|
+
- tmp
|
32
|
+
- vendor
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
Documentation:
|
3
|
+
Enabled: false
|
4
|
+
Rails:
|
5
|
+
Enabled: true
|
6
|
+
AllCops:
|
7
|
+
Include:
|
8
|
+
- app/**/*.rb
|
9
|
+
- lib/**/*.rb
|
10
|
+
- spec/**/*.rb
|
11
|
+
Exclude:
|
12
|
+
- app/assets/**/*
|
13
|
+
- bin/**/*
|
14
|
+
- client/node_modules/**/*
|
15
|
+
- config/**/*
|
16
|
+
- coverage/**/*
|
17
|
+
- data/**/*
|
18
|
+
- db/**/*
|
19
|
+
- db_*/**/*
|
20
|
+
- dw/**/*
|
21
|
+
- log/**/*
|
22
|
+
- phrase/**/*
|
23
|
+
- public/**/*
|
24
|
+
- tmp/**/*
|
25
|
+
- vendor/**/*
|
26
|
+
TargetRubyVersion: 2.5
|
27
|
+
Metrics/LineLength:
|
28
|
+
Max: 100
|
29
|
+
Layout/MultilineMethodCallIndentation:
|
30
|
+
EnforcedStyle: indented
|
31
|
+
Style/PercentLiteralDelimiters:
|
32
|
+
PreferredDelimiters:
|
33
|
+
"%w": "[]"
|
34
|
+
RSpec/ExampleLength:
|
35
|
+
Enabled: false
|
36
|
+
Max: 10
|
37
|
+
RSpec/MultipleExpectations:
|
38
|
+
Enabled: false
|
39
|
+
Max: 10
|
40
|
+
RSpec/NestedGroups:
|
41
|
+
Enabled: false
|
42
|
+
Max: 10
|
43
|
+
RSpec/MessageExpectation:
|
44
|
+
Enabled: false
|
45
|
+
RSpec/MissingExampleGroupArgument:
|
46
|
+
Enabled: false
|
47
|
+
require:
|
48
|
+
- rubocop-performance
|
49
|
+
- rubocop-rspec
|
50
|
+
- test_prof/rubocop
|
51
|
+
Metrics/BlockLength:
|
52
|
+
Enabled: false
|
53
|
+
RSpec/MessageSpies:
|
54
|
+
Enabled: false
|
55
|
+
RSpec/ExpectInHook:
|
56
|
+
Enabled: false
|
57
|
+
RSpec/AggregateFailures:
|
58
|
+
Enabled: true
|
59
|
+
Include:
|
60
|
+
- spec/**/*.rb
|
61
|
+
Rails/InverseOf:
|
62
|
+
Enabled: false
|
63
|
+
Rails/Present:
|
64
|
+
Enabled: false
|
65
|
+
Rails/TimeZone:
|
66
|
+
Enabled: false
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.5
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in rspec-sorbet.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
group :development, :test do
|
7
|
+
gem 'guard-livereload', require: false
|
8
|
+
gem 'guard-rspec'
|
9
|
+
gem 'pry-byebug'
|
10
|
+
gem 'rb-fsevent', require: false
|
11
|
+
gem 'rb-readline'
|
12
|
+
gem 'reek'
|
13
|
+
gem 'rspec'
|
14
|
+
gem 'rubocop-rspec'
|
15
|
+
gem 'rubocop'
|
16
|
+
gem 'shoulda-matchers', require: false
|
17
|
+
gem 'sqlite3'
|
18
|
+
gem 'stackprof'
|
19
|
+
gem 'timecop'
|
20
|
+
end
|
21
|
+
|
22
|
+
group :test do
|
23
|
+
gem 'ffaker'
|
24
|
+
gem 'simplecov'
|
25
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Samuel Giles
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
![dry-monads-sorbet](https://user-images.githubusercontent.com/2643026/69986703-dfc68200-1535-11ea-9035-38ecbdb67138.png)
|
2
|
+
|
3
|
+
# Dry Monads Sorbet ![CI Badge](https://github.com/tricycle/dry-monads-sorbet/workflows/RSpec%20Test%20Suite/badge.svg)
|
4
|
+
|
5
|
+
Sorbet type hints for Dry::Monads.
|
6
|
+
|
7
|
+
## Install
|
8
|
+
|
9
|
+
`gem 'dry-monads-sorbet'`
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'dry/monads/sorbet'
|
15
|
+
|
16
|
+
class MyClass
|
17
|
+
extend T::Sig
|
18
|
+
|
19
|
+
sig{returns(Dry::Monads::Sorbet[StandardError, String])}
|
20
|
+
def my_method
|
21
|
+
...
|
22
|
+
```
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'dry/monads/sorbet'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
4
|
+
require 'dry/monads/sorbet/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'dry-monads-sorbet'
|
8
|
+
spec.version = Dry::Monads::Sorbet::VERSION
|
9
|
+
spec.authors = ['Luke Worth']
|
10
|
+
spec.email = ['luke.worth@bellroy.com']
|
11
|
+
|
12
|
+
spec.summary = 'Sorbet type hints for Dry::Monads'
|
13
|
+
spec.homepage = 'https://github.com/tricycle/dry-monads-sirbet'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
# Specify which files should be added to the gem when it is released.
|
17
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
|
+
f.match(%r{^spec/}) && !f.match(%r{^spec/support/factories/})
|
20
|
+
end
|
21
|
+
spec.bindir = 'exe'
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ['lib']
|
24
|
+
|
25
|
+
spec.add_dependency 'sorbet'
|
26
|
+
spec.add_dependency 'sorbet-runtime'
|
27
|
+
spec.add_dependency 'dry-monads'
|
28
|
+
|
29
|
+
spec.add_development_dependency 'bundler'
|
30
|
+
spec.add_development_dependency 'pry'
|
31
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
32
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
33
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# typed: strict
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
class Dry::Monads::Result
|
5
|
+
extend T::Sig
|
6
|
+
extend T::Generic
|
7
|
+
FailureType = type_member
|
8
|
+
SuccessType = type_member
|
9
|
+
end
|
10
|
+
|
11
|
+
class Dry::Monads::Maybe
|
12
|
+
extend T::Sig
|
13
|
+
extend T::Generic
|
14
|
+
Elem = type_member
|
15
|
+
end
|
data/rbi/dry-monads.rbi
ADDED
@@ -0,0 +1,593 @@
|
|
1
|
+
# typed: strong
|
2
|
+
#
|
3
|
+
# dry-monads-1.3.1
|
4
|
+
#
|
5
|
+
# Note: This file depends on dry/monads/sorbet to define generics.
|
6
|
+
|
7
|
+
module Dry
|
8
|
+
end
|
9
|
+
module Dry::Monads
|
10
|
+
def self.Result(error, **options); end
|
11
|
+
def self.[](*monads); end
|
12
|
+
def self.all_loaded?; end
|
13
|
+
def self.constructors; end
|
14
|
+
def self.included(base); end
|
15
|
+
def self.known_monads; end
|
16
|
+
def self.load_monad(name); end
|
17
|
+
def self.register_mixin(name, mod); end
|
18
|
+
def self.registry; end
|
19
|
+
def self.registry=(registry); end
|
20
|
+
extend Dry::Monads::Maybe::Mixin::Constructors
|
21
|
+
extend Dry::Monads::Maybe::Mixin::Constructors
|
22
|
+
extend Dry::Monads::Result::Mixin::Constructors
|
23
|
+
extend Dry::Monads::Validated::Mixin::Constructors
|
24
|
+
end
|
25
|
+
module Dry::Monads::Curry
|
26
|
+
def self.call(value); end
|
27
|
+
end
|
28
|
+
class Dry::Monads::UnwrapError < StandardError
|
29
|
+
def initialize(ctx); end
|
30
|
+
end
|
31
|
+
class Dry::Monads::InvalidFailureTypeError < StandardError
|
32
|
+
def initialize(failure); end
|
33
|
+
end
|
34
|
+
class Dry::Monads::ConstructorNotAppliedError < NoMethodError
|
35
|
+
def initialize(method_name, constructor_name); end
|
36
|
+
end
|
37
|
+
module Dry::Monads::Transformer
|
38
|
+
def fmap2(*args); end
|
39
|
+
def fmap3(*args); end
|
40
|
+
end
|
41
|
+
class Dry::Monads::Maybe
|
42
|
+
extend T::Helpers
|
43
|
+
abstract!
|
44
|
+
sealed!
|
45
|
+
|
46
|
+
sig do
|
47
|
+
type_parameters(:New)
|
48
|
+
.params(blk: T.proc.params(arg0: Elem).returns(Dry::Monads::Maybe[T.type_parameter(:out, :New)]))
|
49
|
+
.returns(Dry::Monads::Maybe[T.type_parameter(:out, :New)])
|
50
|
+
end
|
51
|
+
def bind(&blk); end
|
52
|
+
|
53
|
+
sig do
|
54
|
+
type_parameters(:New)
|
55
|
+
.params(blk: T.proc.params(arg0: Elem).returns(T.type_parameter(:out, :New)))
|
56
|
+
.returns(Dry::Monads::Maybe[T.type_parameter(:out, :New)])
|
57
|
+
end
|
58
|
+
def fmap(&blk); end
|
59
|
+
|
60
|
+
sig do
|
61
|
+
params(val: T.any(Elem, NilClass),
|
62
|
+
blk: T.nilable(T.proc.returns(Elem)))
|
63
|
+
.returns(Elem)
|
64
|
+
end
|
65
|
+
def value_or(val = nil, &blk); end
|
66
|
+
|
67
|
+
sig do
|
68
|
+
params(arg0: T.untyped)
|
69
|
+
.returns(T.self_type)
|
70
|
+
end
|
71
|
+
def or(*arg0); end
|
72
|
+
|
73
|
+
sig do
|
74
|
+
type_parameters(:Error)
|
75
|
+
.params(val: T.nilable(T.type_parameter(:Error)),
|
76
|
+
blk: T.nilable(T.proc.returns(T.type_parameter(:Error))))
|
77
|
+
.returns(Dry::Monads::Result[T.type_parameter(:out, :Error), Elem])
|
78
|
+
end
|
79
|
+
def to_result(val = nil, &blk); end
|
80
|
+
|
81
|
+
sig {returns(T::Boolean)}
|
82
|
+
def failure?; end
|
83
|
+
def monad; end
|
84
|
+
|
85
|
+
sig {returns(T::Boolean)}
|
86
|
+
def none?; end
|
87
|
+
def self.coerce(value); end
|
88
|
+
def self.lift(*args, &block); end
|
89
|
+
def self.pure(value = nil, &block); end
|
90
|
+
def self.to_proc; end
|
91
|
+
|
92
|
+
sig {returns(T::Boolean)}
|
93
|
+
def some?; end
|
94
|
+
|
95
|
+
sig {returns(T::Boolean)}
|
96
|
+
def success?; end
|
97
|
+
def to_maybe; end
|
98
|
+
def to_monad; end
|
99
|
+
include Dry::Monads::Transformer
|
100
|
+
end
|
101
|
+
class Dry::Monads::Maybe::Some < Dry::Monads::Maybe
|
102
|
+
extend T::Sig
|
103
|
+
extend T::Generic
|
104
|
+
Elem = type_member
|
105
|
+
|
106
|
+
sig {params(value: Elem).void}
|
107
|
+
def initialize(value = nil); end
|
108
|
+
|
109
|
+
sig do
|
110
|
+
returns(Elem)
|
111
|
+
end
|
112
|
+
def value!; end
|
113
|
+
|
114
|
+
def inspect; end
|
115
|
+
def maybe(*args, &block); end
|
116
|
+
def self.[](*value); end
|
117
|
+
def self.call(*arg0); end
|
118
|
+
def self.to_proc; end
|
119
|
+
def to_s; end
|
120
|
+
include Anonymous_Dry_Equalizer_33
|
121
|
+
include Dry::Equalizer::Methods
|
122
|
+
end
|
123
|
+
module Anonymous_Dry_Equalizer_33
|
124
|
+
def cmp?(comparator, other); end
|
125
|
+
def hash; end
|
126
|
+
def inspect; end
|
127
|
+
end
|
128
|
+
class Dry::Monads::Maybe::None < Dry::Monads::Maybe
|
129
|
+
extend T::Sig
|
130
|
+
extend T::Generic
|
131
|
+
Elem = type_member
|
132
|
+
|
133
|
+
def ==(other); end
|
134
|
+
def deconstruct; end
|
135
|
+
def eql?(other); end
|
136
|
+
def hash; end
|
137
|
+
sig {params().void}
|
138
|
+
def initialize(); end
|
139
|
+
def inspect; end
|
140
|
+
def maybe(*arg0); end
|
141
|
+
def or(*args); end
|
142
|
+
def or_fmap(*args, &block); end
|
143
|
+
def self.instance; end
|
144
|
+
def self.method_missing(m, *arg1); end
|
145
|
+
def to_s; end
|
146
|
+
def trace; end
|
147
|
+
include Dry::Core::Constants
|
148
|
+
end
|
149
|
+
module Dry::Monads::Maybe::Mixin
|
150
|
+
include Dry::Monads::Maybe::Mixin::Constructors
|
151
|
+
end
|
152
|
+
module Dry::Monads::Maybe::Mixin::Constructors
|
153
|
+
sig {type_parameters(:T).params(value: T.nilable(T.type_parameter(:T))).returns(Dry::Monads::Maybe[T.type_parameter(:T)])}
|
154
|
+
def Maybe(value); end
|
155
|
+
sig {type_parameters(:T).params().returns(Dry::Monads::Maybe[T.type_parameter(:out, :T)])}
|
156
|
+
def None; end
|
157
|
+
sig {type_parameters(:T).params(value: T.type_parameter(:T)).returns(Dry::Monads::Maybe[T.type_parameter(:T)])}
|
158
|
+
def Some(value = nil); end
|
159
|
+
end
|
160
|
+
module Dry::Monads::Maybe::Hash
|
161
|
+
def self.all(hash, trace = nil); end
|
162
|
+
def self.filter(hash); end
|
163
|
+
end
|
164
|
+
class Dry::Monads::Result
|
165
|
+
extend T::Helpers
|
166
|
+
abstract!
|
167
|
+
sealed!
|
168
|
+
|
169
|
+
sig do
|
170
|
+
type_parameters(:NewSuccessType)
|
171
|
+
.params(blk: T.proc.params(arg0: SuccessType).returns(Dry::Monads::Result[FailureType, T.type_parameter(:out, :NewSuccessType)]))
|
172
|
+
.returns(Dry::Monads::Result[FailureType, T.type_parameter(:out, :NewSuccessType)])
|
173
|
+
end
|
174
|
+
def bind(&blk); end
|
175
|
+
|
176
|
+
sig do
|
177
|
+
type_parameters(:New)
|
178
|
+
.params(blk: T.proc.params(arg0: SuccessType).returns(T.type_parameter(:out, :New)))
|
179
|
+
.returns(Dry::Monads::Result[FailureType, T.type_parameter(:out, :New)])
|
180
|
+
end
|
181
|
+
def fmap(&blk); end
|
182
|
+
|
183
|
+
sig do
|
184
|
+
type_parameters(:Val)
|
185
|
+
.params(val: T.nilable(T.type_parameter(:Val)), blk: T.nilable(T.proc.params(arg0: FailureType).returns(T.type_parameter(:Val))))
|
186
|
+
.returns(T.any(SuccessType, T.type_parameter(:Val)))
|
187
|
+
end
|
188
|
+
def value_or(val = nil, &blk); end
|
189
|
+
|
190
|
+
sig do
|
191
|
+
returns(SuccessType)
|
192
|
+
end
|
193
|
+
def value!; end
|
194
|
+
def to_maybe; end
|
195
|
+
def either(f, _); end
|
196
|
+
|
197
|
+
sig {returns(T::Boolean)}
|
198
|
+
def success?; end
|
199
|
+
|
200
|
+
sig {returns(T::Boolean)}
|
201
|
+
def failure?; end
|
202
|
+
|
203
|
+
sig {returns(FailureType)}
|
204
|
+
def failure; end
|
205
|
+
|
206
|
+
sig do
|
207
|
+
params(blk: T.proc.params(arg0: FailureType).returns(Dry::Monads::Result[FailureType, SuccessType]))
|
208
|
+
.returns(Dry::Monads::Result[FailureType, SuccessType])
|
209
|
+
end
|
210
|
+
def or(&blk); end
|
211
|
+
|
212
|
+
def monad; end
|
213
|
+
def self.pure(value = nil, &block); end
|
214
|
+
def success; end
|
215
|
+
def to_monad; end
|
216
|
+
def to_result; end
|
217
|
+
include Anonymous_Module_34
|
218
|
+
include Dry::Monads::Transformer
|
219
|
+
end
|
220
|
+
class Dry::Monads::Result::Success < Dry::Monads::Result
|
221
|
+
extend T::Sig
|
222
|
+
extend T::Generic
|
223
|
+
FailureType = type_member
|
224
|
+
SuccessType = type_member
|
225
|
+
|
226
|
+
def flip; end
|
227
|
+
def initialize(value); end
|
228
|
+
def inspect; end
|
229
|
+
def result(_, f); end
|
230
|
+
def self.[](*value); end
|
231
|
+
def self.call(*arg0); end
|
232
|
+
def self.to_proc; end
|
233
|
+
def success; end
|
234
|
+
def to_s; end
|
235
|
+
def to_validated; end
|
236
|
+
include Anonymous_Dry_Equalizer_35
|
237
|
+
include Dry::Equalizer::Methods
|
238
|
+
end
|
239
|
+
class Dry::Monads::Result::Failure < Dry::Monads::Result
|
240
|
+
extend T::Sig
|
241
|
+
extend T::Generic
|
242
|
+
FailureType = type_member
|
243
|
+
SuccessType = type_member
|
244
|
+
|
245
|
+
def ===(other); end
|
246
|
+
def failure; end
|
247
|
+
def flip; end
|
248
|
+
def initialize(value, trace = nil); end
|
249
|
+
def inspect; end
|
250
|
+
def or_fmap(*args, &block); end
|
251
|
+
def result(f, _); end
|
252
|
+
def self.[](*value); end
|
253
|
+
def self.call(*arg0); end
|
254
|
+
def self.to_proc; end
|
255
|
+
def to_s; end
|
256
|
+
def to_validated; end
|
257
|
+
def trace; end
|
258
|
+
def value_or(val = nil); end
|
259
|
+
include Anonymous_Dry_Equalizer_36
|
260
|
+
include Dry::Equalizer::Methods
|
261
|
+
end
|
262
|
+
class Dry::Monads::Task
|
263
|
+
def ==(other); end
|
264
|
+
def apply(val = nil); end
|
265
|
+
def bind(&block); end
|
266
|
+
def compare_promises(x, y); end
|
267
|
+
def complete?; end
|
268
|
+
def curry(value); end
|
269
|
+
def discard; end
|
270
|
+
def fmap(&block); end
|
271
|
+
def initialize(promise); end
|
272
|
+
def inspect; end
|
273
|
+
def monad; end
|
274
|
+
def or(&block); end
|
275
|
+
def or_fmap(&block); end
|
276
|
+
def promise; end
|
277
|
+
def self.[](executor, &block); end
|
278
|
+
def self.failed(exc); end
|
279
|
+
def self.new(promise = nil, &block); end
|
280
|
+
def self.pure(value = nil, &block); end
|
281
|
+
def then(&block); end
|
282
|
+
def to_maybe; end
|
283
|
+
def to_monad; end
|
284
|
+
def to_result; end
|
285
|
+
def to_s; end
|
286
|
+
def value!; end
|
287
|
+
def value_or(&block); end
|
288
|
+
def wait(timeout = nil); end
|
289
|
+
include Anonymous_Module_37
|
290
|
+
end
|
291
|
+
class Dry::Monads::Try
|
292
|
+
def error?; end
|
293
|
+
def exception; end
|
294
|
+
def failure?; end
|
295
|
+
def self.[](*exceptions, &block); end
|
296
|
+
def self.lift(*args, &block); end
|
297
|
+
def self.pure(value = nil, exceptions = nil, &block); end
|
298
|
+
def self.run(exceptions, f); end
|
299
|
+
def success?; end
|
300
|
+
def to_monad; end
|
301
|
+
def value?; end
|
302
|
+
include Anonymous_Module_38
|
303
|
+
end
|
304
|
+
class Dry::Monads::Try::Value < Dry::Monads::Try
|
305
|
+
extend T::Generic
|
306
|
+
FailureType = type_member
|
307
|
+
SuccessType = type_member
|
308
|
+
|
309
|
+
def bind(*args); end
|
310
|
+
def bind_call(*args, **kwargs); end
|
311
|
+
def catchable; end
|
312
|
+
def fmap(*args, &block); end
|
313
|
+
def initialize(exceptions, value); end
|
314
|
+
def inspect; end
|
315
|
+
def self.call(*arg0); end
|
316
|
+
def self.to_proc; end
|
317
|
+
def to_maybe; end
|
318
|
+
def to_result; end
|
319
|
+
def to_s; end
|
320
|
+
include Anonymous_Dry_Equalizer_39
|
321
|
+
include Dry::Equalizer::Methods
|
322
|
+
end
|
323
|
+
class Dry::Monads::Try::Error < Dry::Monads::Try
|
324
|
+
extend T::Generic
|
325
|
+
FailureType = type_member
|
326
|
+
SuccessType = type_member
|
327
|
+
|
328
|
+
def ===(other); end
|
329
|
+
def initialize(exception); end
|
330
|
+
def inspect; end
|
331
|
+
def or(*args); end
|
332
|
+
def self.call(*arg0); end
|
333
|
+
def to_maybe; end
|
334
|
+
def to_result; end
|
335
|
+
def to_s; end
|
336
|
+
include Anonymous_Dry_Equalizer_40
|
337
|
+
include Dry::Equalizer::Methods
|
338
|
+
end
|
339
|
+
class Dry::Monads::Validated
|
340
|
+
def bind(*arg0); end
|
341
|
+
def self.pure(value = nil, &block); end
|
342
|
+
def to_monad; end
|
343
|
+
include Anonymous_Module_41
|
344
|
+
end
|
345
|
+
class Dry::Monads::Validated::Valid < Dry::Monads::Validated
|
346
|
+
def ===(other); end
|
347
|
+
def alt_map(_ = nil); end
|
348
|
+
def apply(val = nil); end
|
349
|
+
def fmap(proc = nil, &block); end
|
350
|
+
def initialize(value); end
|
351
|
+
def inspect; end
|
352
|
+
def or(_ = nil); end
|
353
|
+
def to_maybe; end
|
354
|
+
def to_result; end
|
355
|
+
def to_s; end
|
356
|
+
def value!; end
|
357
|
+
include Anonymous_Dry_Equalizer_42
|
358
|
+
include Dry::Equalizer::Methods
|
359
|
+
end
|
360
|
+
class Dry::Monads::Validated::Invalid < Dry::Monads::Validated
|
361
|
+
def ===(other); end
|
362
|
+
def alt_map(proc = nil, &block); end
|
363
|
+
def apply(val = nil); end
|
364
|
+
def error; end
|
365
|
+
def fmap(_ = nil); end
|
366
|
+
def initialize(error, trace = nil); end
|
367
|
+
def inspect; end
|
368
|
+
def or(proc = nil, &block); end
|
369
|
+
def to_maybe; end
|
370
|
+
def to_result; end
|
371
|
+
def to_s; end
|
372
|
+
def trace; end
|
373
|
+
include Anonymous_Dry_Equalizer_43
|
374
|
+
include Dry::Equalizer::Methods
|
375
|
+
end
|
376
|
+
module Dry::Monads::ConversionStubs
|
377
|
+
def self.[](*method_names); end
|
378
|
+
end
|
379
|
+
module Dry::Monads::ConversionStubs::Methods
|
380
|
+
def self.to_maybe; end
|
381
|
+
def self.to_result; end
|
382
|
+
def self.to_validated; end
|
383
|
+
def to_maybe; end
|
384
|
+
def to_result; end
|
385
|
+
def to_validated; end
|
386
|
+
end
|
387
|
+
class Dry::Monads::Task::Promise < Concurrent::Promise
|
388
|
+
def on_fulfill(result); end
|
389
|
+
def on_reject(reason); end
|
390
|
+
end
|
391
|
+
module Anonymous_Module_37
|
392
|
+
def to_maybe(*arg0); end
|
393
|
+
def to_result(*arg0); end
|
394
|
+
end
|
395
|
+
module Dry::Monads::Task::Mixin
|
396
|
+
def self.[](executor); end
|
397
|
+
include Dry::Monads::Task::Mixin::Constructors
|
398
|
+
end
|
399
|
+
module Dry::Monads::Task::Mixin::Constructors
|
400
|
+
def Task(&block); end
|
401
|
+
end
|
402
|
+
module Anonymous_Module_34
|
403
|
+
def to_maybe(*arg0); end
|
404
|
+
def to_validated(*arg0); end
|
405
|
+
end
|
406
|
+
module Anonymous_Dry_Equalizer_35
|
407
|
+
def cmp?(comparator, other); end
|
408
|
+
def hash; end
|
409
|
+
def inspect; end
|
410
|
+
end
|
411
|
+
module Anonymous_Dry_Equalizer_36
|
412
|
+
def cmp?(comparator, other); end
|
413
|
+
def hash; end
|
414
|
+
def inspect; end
|
415
|
+
end
|
416
|
+
module Dry::Monads::Result::Mixin
|
417
|
+
include Dry::Monads::Result::Mixin::Constructors
|
418
|
+
end
|
419
|
+
module Dry::Monads::Result::Mixin::Constructors
|
420
|
+
sig do
|
421
|
+
type_parameters(:FailureType, :SuccessType)
|
422
|
+
.params(value: T.nilable(T.type_parameter(:FailureType)),
|
423
|
+
block: T.nilable(T.untyped))
|
424
|
+
.returns(Dry::Monads::Result[T.type_parameter(:FailureType),
|
425
|
+
T.type_parameter(:out, :SuccessType)])
|
426
|
+
end
|
427
|
+
def Failure(value = nil, &block); end
|
428
|
+
|
429
|
+
sig do
|
430
|
+
type_parameters(:FailureType, :SuccessType)
|
431
|
+
.params(value: T.nilable(T.type_parameter(:SuccessType)),
|
432
|
+
block: T.nilable(T.untyped))
|
433
|
+
.returns(Dry::Monads::Result[T.type_parameter(:out, :FailureType),
|
434
|
+
T.type_parameter(:SuccessType)])
|
435
|
+
end
|
436
|
+
def Success(value = nil, &block); end
|
437
|
+
end
|
438
|
+
module Anonymous_Module_38
|
439
|
+
def to_maybe(*arg0); end
|
440
|
+
def to_result(*arg0); end
|
441
|
+
end
|
442
|
+
module Anonymous_Dry_Equalizer_39
|
443
|
+
def cmp?(comparator, other); end
|
444
|
+
def hash; end
|
445
|
+
def inspect; end
|
446
|
+
end
|
447
|
+
module Anonymous_Dry_Equalizer_40
|
448
|
+
def cmp?(comparator, other); end
|
449
|
+
def hash; end
|
450
|
+
def inspect; end
|
451
|
+
end
|
452
|
+
module Dry::Monads::Try::Mixin
|
453
|
+
def Error(error = nil, &block); end
|
454
|
+
def Value(value = nil, exceptions = nil, &block); end
|
455
|
+
include Dry::Monads::Try::Mixin::Constructors
|
456
|
+
end
|
457
|
+
module Dry::Monads::Try::Mixin::Constructors
|
458
|
+
def Try(*exceptions, &f); end
|
459
|
+
end
|
460
|
+
module Anonymous_Module_41
|
461
|
+
def to_maybe(*arg0); end
|
462
|
+
def to_result(*arg0); end
|
463
|
+
end
|
464
|
+
module Anonymous_Dry_Equalizer_42
|
465
|
+
def cmp?(comparator, other); end
|
466
|
+
def hash; end
|
467
|
+
def inspect; end
|
468
|
+
end
|
469
|
+
module Anonymous_Dry_Equalizer_43
|
470
|
+
def cmp?(comparator, other); end
|
471
|
+
def hash; end
|
472
|
+
def inspect; end
|
473
|
+
end
|
474
|
+
module Dry::Monads::Validated::Mixin
|
475
|
+
include Dry::Monads::Validated::Mixin::Constructors
|
476
|
+
end
|
477
|
+
module Dry::Monads::Validated::Mixin::Constructors
|
478
|
+
def Invalid(value = nil, &block); end
|
479
|
+
def Valid(value = nil, &block); end
|
480
|
+
end
|
481
|
+
class Dry::Monads::List
|
482
|
+
def +(other); end
|
483
|
+
def apply(list = nil); end
|
484
|
+
def bind(*args); end
|
485
|
+
def coerce(other); end
|
486
|
+
def collect; end
|
487
|
+
def deconstruct; end
|
488
|
+
def empty?; end
|
489
|
+
def filter; end
|
490
|
+
def first; end
|
491
|
+
def fmap(*args); end
|
492
|
+
def fold_left(initial); end
|
493
|
+
def fold_right(initial); end
|
494
|
+
def foldl(initial); end
|
495
|
+
def foldr(initial); end
|
496
|
+
def head; end
|
497
|
+
def initialize(value, type = nil); end
|
498
|
+
def inspect; end
|
499
|
+
def last; end
|
500
|
+
def map(&block); end
|
501
|
+
def monad; end
|
502
|
+
def reduce(initial); end
|
503
|
+
def reverse; end
|
504
|
+
def select; end
|
505
|
+
def self.[](*values); end
|
506
|
+
def self.coerce(value, type = nil); end
|
507
|
+
def self.pure(value = nil, type = nil, &block); end
|
508
|
+
def self.unfold(state, type = nil); end
|
509
|
+
def size; end
|
510
|
+
def sort; end
|
511
|
+
def tail; end
|
512
|
+
def to_a; end
|
513
|
+
def to_ary; end
|
514
|
+
def to_monad; end
|
515
|
+
def to_s; end
|
516
|
+
def traverse(proc = nil, &block); end
|
517
|
+
def type; end
|
518
|
+
def typed(type = nil); end
|
519
|
+
def typed?; end
|
520
|
+
def value; end
|
521
|
+
extend Anonymous_Dry_Core_Deprecations_Tagged_44
|
522
|
+
extend Dry::Core::Deprecations::Interface
|
523
|
+
include Anonymous_Dry_Equalizer_45
|
524
|
+
include Dry::Equalizer::Methods
|
525
|
+
include Dry::Monads::Transformer
|
526
|
+
end
|
527
|
+
module Anonymous_Dry_Core_Deprecations_Tagged_44
|
528
|
+
end
|
529
|
+
module Anonymous_Dry_Equalizer_45
|
530
|
+
def cmp?(comparator, other); end
|
531
|
+
def hash; end
|
532
|
+
def inspect; end
|
533
|
+
end
|
534
|
+
class Dry::Monads::List::ListBuilder
|
535
|
+
def [](*args); end
|
536
|
+
def coerce(value); end
|
537
|
+
def initialize(type); end
|
538
|
+
def pure(val = nil, &block); end
|
539
|
+
def self.[](*arg0); end
|
540
|
+
def type; end
|
541
|
+
end
|
542
|
+
module Dry::Monads::List::Mixin
|
543
|
+
def List(value); end
|
544
|
+
end
|
545
|
+
module Dry::Monads::Do
|
546
|
+
def self.coerce_to_monad(monads); end
|
547
|
+
def self.for(*methods); end
|
548
|
+
def self.halt(result); end
|
549
|
+
def self.included(base); end
|
550
|
+
def self.wrap_method(target, method_name); end
|
551
|
+
extend Dry::Monads::Do::Mixin
|
552
|
+
end
|
553
|
+
module Dry::Monads::Do::Mixin
|
554
|
+
def bind(monads); end
|
555
|
+
def call; end
|
556
|
+
end
|
557
|
+
class Dry::Monads::Do::Halt < StandardError
|
558
|
+
def initialize(result); end
|
559
|
+
def result; end
|
560
|
+
end
|
561
|
+
module Dry::Monads::Do::All
|
562
|
+
def self.included(base); end
|
563
|
+
extend Dry::Monads::Do::All::InstanceMixin
|
564
|
+
end
|
565
|
+
class Dry::Monads::Do::All::MethodTracker < Module
|
566
|
+
def extend_object(target); end
|
567
|
+
def initialize(wrappers); end
|
568
|
+
def wrap_method(target, method); end
|
569
|
+
def wrappers; end
|
570
|
+
end
|
571
|
+
module Dry::Monads::Do::All::InstanceMixin
|
572
|
+
def extended(object); end
|
573
|
+
end
|
574
|
+
class Dry::Monads::Lazy < Dry::Monads::Task
|
575
|
+
def force!; end
|
576
|
+
def force; end
|
577
|
+
def inspect; end
|
578
|
+
def self.[](executor, &block); end
|
579
|
+
def self.new(promise = nil, &block); end
|
580
|
+
def to_s; end
|
581
|
+
def value!; end
|
582
|
+
end
|
583
|
+
module Dry::Monads::Lazy::Mixin
|
584
|
+
include Dry::Monads::Lazy::Mixin::Constructors
|
585
|
+
end
|
586
|
+
module Dry::Monads::Lazy::Mixin::Constructors
|
587
|
+
def Lazy(&block); end
|
588
|
+
end
|
589
|
+
class Dry::Monads::Result::Fixed < Module
|
590
|
+
def included(base); end
|
591
|
+
def initialize(error, **options); end
|
592
|
+
def self.[](error, **options); end
|
593
|
+
end
|
metadata
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dry-monads-sorbet
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Luke Worth
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-12-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sorbet
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sorbet-runtime
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: dry-monads
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: bundler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '10.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '10.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '3.0'
|
111
|
+
description:
|
112
|
+
email:
|
113
|
+
- luke.worth@bellroy.com
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".github/workflows/rspec.yml"
|
119
|
+
- ".gitignore"
|
120
|
+
- ".reek.yml"
|
121
|
+
- ".rspec"
|
122
|
+
- ".rubocop.yml"
|
123
|
+
- ".ruby-version"
|
124
|
+
- CHANGELOG.md
|
125
|
+
- Gemfile
|
126
|
+
- LICENSE.txt
|
127
|
+
- README.md
|
128
|
+
- Rakefile
|
129
|
+
- bin/console
|
130
|
+
- bin/setup
|
131
|
+
- dry-monads-sorbet.gemspec
|
132
|
+
- lib/dry/monads/sorbet.rb
|
133
|
+
- lib/dry/monads/sorbet/version.rb
|
134
|
+
- rbi/dry-monads.rbi
|
135
|
+
homepage: https://github.com/tricycle/dry-monads-sirbet
|
136
|
+
licenses:
|
137
|
+
- MIT
|
138
|
+
metadata: {}
|
139
|
+
post_install_message:
|
140
|
+
rdoc_options: []
|
141
|
+
require_paths:
|
142
|
+
- lib
|
143
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
requirements: []
|
154
|
+
rubyforge_project:
|
155
|
+
rubygems_version: 2.7.6.2
|
156
|
+
signing_key:
|
157
|
+
specification_version: 4
|
158
|
+
summary: Sorbet type hints for Dry::Monads
|
159
|
+
test_files: []
|