Skip to content

Conversation

@baransu
Copy link

@baransu baransu commented Apr 9, 2019

The basic implementation working for simple cases 🙂

Currently, friendStreetNumber lens compiles but returns an invalid result because we're not accepting enough nested field. With other types, it wouldn't compile.

The optional operator is subject to change but ? is not a valid infix operator and PPX have to be valid Reason if we want to use the AST.

@cem2ran
Copy link
Owner

cem2ran commented Aug 2, 2019

Hey @baransu, time flies 😱 Sorry about that!

What do you think about the following two ideas for optional operator:

[%focus person |. department |. address |? street_number]
[%focus person -> department -> address -?> street_number]

|* or -*> would be used for traversal, etc.

[%focus person |. departments |* address |? street_number]
[%focus person -> departments -*> address -?> street_number]

Appears to be valid syntax: https://astexplorer.net/#/gist/8b6189cbc0c84f3678bd45191b93989b/84db4f5e9143e06a62ac675c4c63c515ccf9e1c9

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.

2 participants