Skip to content

feat(combinators): Adds various basic combinators & impls for std types#34

Merged
de-vri-es merged 4 commits intofizyr:mainfrom
grenewode:feat/variable-map-combinators
Aug 29, 2025
Merged

feat(combinators): Adds various basic combinators & impls for std types#34
de-vri-es merged 4 commits intofizyr:mainfrom
grenewode:feat/variable-map-combinators

Conversation

@grenewode
Copy link
Contributor

@grenewode grenewode commented Aug 26, 2025

- Adds combinators for `fallback` and `map_value`
- Adds implementations of `VariableMap` for slices, arrays, vectors,
  `Box`s, `Rc`s and `Arc`s
- Fixes fizyr#20
  See [example](examples/merge-environments.rs)
@grenewode grenewode force-pushed the feat/variable-map-combinators branch from 2e5e274 to ad55676 Compare August 26, 2025 04:37
@de-vri-es
Copy link
Contributor

Thanks for the PR! I think adding these is a nice improvement!

I do think I want to re-organize the module layout a bit, to avoid having all these combinators in the crate root. But don't worry about that, I think it's easier to merge as is and then I can go over the module layout.

I still need to do an in-depth review. Will keep you posted :)

@de-vri-es de-vri-es self-assigned this Aug 26, 2025
@grenewode
Copy link
Contributor Author

Yeah, I did notice that; it would be nice to have map::fallback, etc. I couldn't figure out a way to manage that without making larger changes though.

@de-vri-es
Copy link
Contributor

Yeah, no worries. I prefer to do that part myself anyway :)

@grenewode
Copy link
Contributor Author

I did wonder about adding (T0, T1, ...) instead of fallback. I didn't end up going that with that, because it could be ambiguous with other expectations.

@de-vri-es
Copy link
Contributor

I did wonder about adding (T0, T1, ...) instead of fallback. I didn't end up going that with that, because it could be ambiguous with other expectations.

👍 I think a new struct is indeed more clear and easier to discover in the docs :)

@de-vri-es de-vri-es merged commit 5167909 into fizyr:main Aug 29, 2025
1 check passed
@de-vri-es
Copy link
Contributor

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fallback to Env when variables missing some key

2 participants