Comments (6)
Typically you'd use the operators for this instead.
from aether.
As long as we are throwing personal preferences in, I'm the opposite - I prefer explicit module names, especially when the chance of name collision is high and Lens and Prism would typically be used in the same context.
For personal preferences auto-opened Prelude in your project file is the way to go. That would be ideal place to alias functions you want into an auto-opened module.
from aether.
@cmeeren - the entire way Aether is written, even down to the type level is designed to be maximally flexible and compatible.
In general, qualified access serves as a stopgap measure in the absence of proper HKT support, much like List
, Set
and Map
do.
The library (in general) tries to provide some conventions on how to do things; with the operators offering very decent syntax for most tasks. if you'd like to write your own get/set functions, they're incredibly trivial to do in your own prelude.
from aether.
Can you do x |> set a_ "a" |> set b_ "b" |> ...
with operators?
In any case, I often prefer functions over custom operators for legibility reasons, and it's nice to have the option. 😊 Particularly since The change is trivial.
from aether.
Sure, but removing RequireQualifiedAccessAttribute
doesn't change anything for you or other users who prefer explicit module names. It's a tiny and fully backwards compatible change that doesn't impact anyone except those that choose to make use of it. It makes Aether more flexible without adding any maintenance burden or impacting those who aren't interested.
from aether.
stopgap measure
Against what, would be my question. I don't see the harm in allowing the module to be opened. It won't impact anyone except those users who deliberately try to do it.
much like
List
,Set
andMap
do.
I don't think it's a fair comparison; those modules (and Option
, Array
, etc.) contain a lot of functions, many of which have the same names (since they're all functors/monads/etc.). Optic
contains get
, map
, and set
(and hopefully over
at some point, #57).
and Lens and Prism would typically be used in the same context.
This issue is only about Optic
, not Lens
and Prism
.
In any case, though I stand by my position that this would be a convenience, it's a fairly minor one (as you point out), and not something I personally feel is worth further discussion. Feel free to close. 🙂
from aether.
Related Issues (20)
- Nuget package for .Net 3.5 HOT 8
- Convention for lens declarations HOT 26
- Make Aether a portable library HOT 4
- Add to fsharp.org/community/projects HOT 2
- Lenses on Generic Records HOT 8
- key_ and others are gone HOT 5
- Setting a key in a map doesn't add the key if it isn't already there HOT 2
- Sign the aether assemblies with a strong name HOT 9
- The indentation in Aether.Operators' documentation is messed up HOT 1
- Support .NET Core HOT 1
- The `^=` operator seems backwards, and I'm not sure about the `^%` operator HOT 5
- Usage question: default value for lens to option?
- Website doesn't work HOT 2
- Add Optic.over to update a value
- Change Lens type from Tuple to a record/union HOT 5
- Simplified documentation example? HOT 1
- Update tests from deprecated .NET Core 2.2 to .NET 6
- What are the goals of lens vs. prism forms of map access?
- How to write a lens for grandchildren by ID when you don't know the child ID
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 aether.