[docsite] Fix links

This commit is contained in:
Sean Collins 2022-01-26 13:42:09 -04:00
parent 7d336aa8ee
commit e894966469
2 changed files with 4 additions and 4 deletions

View File

@ -41,7 +41,7 @@ Types::Strict::Integer.maybe["foo"] # => raises Dry::Types::ConstraintError
```
If you want to capture the errors (e.g. to return messages) instead of raising them, you may want to use the [`:monads` extension](docs::extension::monads) instead, which returns a `Result`.
If you want to capture the errors (e.g. to return messages) instead of raising them, you may want to use the [`:monads` extension](docs::extensions/monads) instead, which returns a `Result`.
Or, if you prefer, instead of calling `.maybe` you can use the `Maybe::` namespaced types instead.

View File

@ -4,7 +4,7 @@ layout: gem-single
name: dry-types
---
The `:monads` extension provides a `#to_monad` method that returns a `Result` compatible with [`dry-monads`]('/gems/dry-monads').
The `:monads` extension provides a `#to_monad` method that returns a `Result` compatible with [`dry-monads`]('/gems/dry-monads/').
The `.try` method returns a simple `Result` that's defined within `dry-types` (i.e. `Dry::Types::Result`).
If you want to use the result with `dry-monads`, you can load this extension and call `#to_monad` on the `Dry::Types::Result` to get a `Result` that's defined in `dry-monads` (i.e. `Dry::Monads::Result`). This will let you use the `dry-monads` methods on the result.
@ -36,10 +36,10 @@ monad
.or { |error, input| puts "input '#{input.inspect}' failed with error: #{error.to_s}" }
```
Note that you must use the `.try` method and not the `.[]` method, since that skips the intermediate `Result` object and just returns the value. If you want to use the `.[]` method and also have errors be raised rather than captured in `Failure`, then you can consider using the [`:maybe` extension](docs::extensions::maybe) instead.
Note that you must use the `.try` method and not the `.[]` method, since that skips the intermediate `Result` object and just returns the value. If you want to use the `.[]` method and also have errors be raised rather than captured in `Failure`, then you can consider using the [`:maybe` extension](docs::extensions/maybe) instead.
## `dry-monads` Do notation
This can be useful with [`do` notation](/gems/dry-monads/1.2/do-notation/) in `dry-monads`.
This can be useful with [`do` notation](/gems/dry-monads/1.3/do-notation/) in `dry-monads`.
```ruby
require 'dry/types'