Comments (2)
When you have a field that has an optional type, there is an optic to address this fact. You can look for Optional
(in the last released version), which has been renamed to AffineTraversal
in the next release we will do.
You can check the documentation of how to write your own AffineTraversal
/Optional
and [how to get it automatically]. Also, we have documented its API.
In your particular example, and using Bow 0.8.0, it would be something like:
struct Handle: AutoOptional {}
struct Door: AutoOptional {
var handle: Handle?
}
struct Car: AutoOptional {
var door: Door?
}
Car.optional(for: \.door) + Door.optional(for: \handle)
from bow.
thanks 😘
from bow.
Related Issues (20)
- Zipper API Reference
- ["Bug"] Optics docs cannot be loaded HOT 1
- ["Request"] or combinator for Prisms HOT 1
- ["Request"] Add extract and embed properties to Prism HOT 1
- ["Request"] Improve binding with function builders HOT 3
- ["Request"] Tree data type HOT 3
- ["Bug"] I lost `BowGeneric` Modules HOT 4
- Documentation for simulated rank-n polymorphism (aka documentation on FunctionK) HOT 4
- ["Request"] Monad, Applicative and Functor instances for Trampoline HOT 6
- ["Request"] Add conversion from Foldable to ArrayK HOT 1
- ["Bug"] Free foldMap is not stack safe HOT 2
- ["Request"] Pair type HOT 1
- ["Request"] Simulation for derive (generic programming) HOT 4
- ["Request"] StackSafeMonad HOT 1
- ["Request"] New syntax for partial application HOT 6
- Question: How to convert ReaderT to different F? HOT 4
- Question: Easier flatMap api for ReaderT? HOT 2
- Migrate from Rx to Combine
- Project status HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bow.