Comments (6)
At least the Map implementation is the exact same code as F#. Block uses tuples which should be very efficient (since Python knows they are immutable and backed by c-code). I'm considering changing the Fable List impl. to use tuples when targeting Python. But it's hard to optimize lists. They just get better at one thing, and worse at another 😄
from expression.
Yes, I could have done that now using Fable, but at the time I did it manually line by line. You can see that the Fable code (to the right) is not that different from Expression (on the left), but Fable still has a few more typing issues.
from expression.
Oh wow, thats impressive on both sides 😄
from expression.
@ShalokShalom the collections are implemented as immutable data-structures, but in Python nothing is really immutable except str
, tuple
, so for example the Block
is an immutable list built on a tuple, and using the Block
with the API provided will keep it immutable. But the class containing the tuple is not immutable, so you could always replace the tuple. We could try to make that harder to do, but it's not really the goals of this library to work around such issues with Python. But for classes like Block
we could improve things and make the contained value e.g prefixed with underscore or double underscore.
from expression.
Oh, I mean do they copy or reference? I mean, are they efficient, as immutable data structures in Clojure or FSharp? Or do they really copy stuff around, even though nothing is changed?
from expression.
Exact same code? You mean you transpiled your/a F# map implementation to Python?
from expression.
Related Issues (20)
- Fishy locking in CancellationSource HOT 1
- Issue on page /tutorial/effects.html HOT 3
- Feature request: implement hash for `Some`, `Result` and `default_with` to generate default value lazily. HOT 1
- Generic monad algorithm HOT 1
- 4.2.0 has invalid python 3.9 syntax HOT 1
- change function for map does not appear to work correctly HOT 2
- Type aliases using Union syntax incompatible with Python 3.9 HOT 4
- Map change drops current items when len is two HOT 1
- How about using TypeAlias with Result and Option? HOT 1
- Is there some helper function to use parameters for function in Result? HOT 1
- Dependency Dashboard
- Is Option or Result type have apply function? HOT 5
- seq.map does not type check correctly HOT 1
- _TSource in Option should be covariant HOT 7
- NonEmptyList
- __str__ and __repr__ of Failure & Success HOT 1
- Improve the ergonomics of pipelines HOT 13
- Actor Model & Railway oriented programming HOT 1
- Question: How do you use @effect.result with asyncio? HOT 1
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 expression.