dry-rb / dry-types

Flexible type system for Ruby with coercions and constraints
https://dry-rb.org/gems/dry-types
MIT License
860 stars 134 forks source link

Added documentation for intersection types #467

Closed emptyflask closed 10 months ago

emptyflask commented 10 months ago

I was working on a project and wanted this functionality, happened to just try using & and it actually worked -- but discovered that this was still an undocumented feature.

So, I wrote up a short page about it, using an example from my real world project.

I also arranged sum & intersection pages under a "Combining Types" section, and placed it after constraints and hash schemas, since this sort of builds on top of those ideas. I didn't see a way to actually test the docsite generation, so hopefully it looks good.

emptyflask commented 10 months ago

Tagging @robhanlon22 in case you wanted to add anything, since you wrote the code.

solnic commented 10 months ago

Thank you :) The docsite should be built via our devtools toolchain and end up automatically in dry-rb.org/gems/dry-types under Main version (then it will be included under the next released version too).

solnic commented 10 months ago

Oops, unfortunately it didn't build correctly:

       error  docs/gems/dry-types/main/combining-types/index.html
section sum not found
emptyflask commented 10 months ago

:grimacing: looks like I messed up the paths. I'll take a look and see if I can get it to build.