Comments (3)
Thanks for the answer ! Very happy to hear it is on the roadmap :) Looking forward to seeing it being rolled out. Great work.
from arrow-core.
@kalistace we agree and this is coming up for all data types that provide Monad around October https://github.com/47deg/arrow-meta-prototype/blob/rr-typeclasses-plugin/compiler-plugin/src/main/kotlin/arrow/meta/comprehensions/ComprehensionsPlugin.kt we are already working in a prototype that rewrites binds as flatMap because that is leaner than suspension. It will still use suspension for the code as it is today but will rewrite it to a nested flatMap
from arrow-core.
Hey @kalistace,
The overhead is neglectable of using suspend
with the new planned encoding. It's a similar penalty as using a simple handwritten DSL, the compiler is leveraged to wire nested fold
code together, and uses a cheap ControlThrowable
to break out of the suspension.
(See Roman's example on using suspend for stack safe functions or the sequence builder for similar low-cost implementations for suspend.)
This also works in a suspended way by leveraging a small state-machine to keep track of the internal state, which can be done by simple Int
flags. #112
You're correct that the current encoding in 0.10.x
and before it is more expensive, but this will be changed with the new encoding. And can later be solved in a generic way with the compiler plugin.
I hope that answers your questions, and what the current state is :)
I'm going to close this issue since it can be tracked in #115 & #116.
Thanks for the feedback! And if you have any questions feel free to ask questions here or on the Kotlin Slack in the #arrow channel ;)
from arrow-core.
Related Issues (20)
- BUILD: error when integrating 'Deprecate @higherkind & @extension for TupleN (#292)' with the rest of Arrow libraries
- BUILD: error when integrating 'Deprecate extension methods for NonEmptyList (#304)' with the rest of Arrow libraries
- BUILD: error when merging 'Deprecate extensions methods for Set and SetK (#299)' on master branch
- DOC: error when integrating 'Fix incorrect package new instances (#306)' with the rest of Arrow libraries
- BUILD: error when integrating 'CU-cew8k0 Remove Deprecated `Id<A>` data type. (#291)' with the rest of Arrow libraries
- BUILD: error when merging 'CU-cn28ya Deprecate @higherkind & @extension for Ior (#317)' on master branch
- BUILD: error when integrating 'Deprecates Kind and its associated type class types. (#281)' with the rest of Arrow libraries
- BUILD: error when integrating 'Deprecates Kind and its associated type class types. (#281)' with the rest of Arrow libraries
- BUILD: error when integrating 'Deprecate Show (#321)' with the rest of Arrow libraries
- BUILD: error when merging 'Deprecate Eq (#322)' on master branch HOT 1
- BUILD: error when integrating 'CU-cn24b4 Remove extension and higherkind annotations for Const (#315)' with the rest of Arrow libraries
- BUILD: error when integrating 'CU-cn24b4 Remove extension and higherkind annotations for Const (#315)' with the rest of Arrow libraries
- BUILD: error when integrating 'Fix typo in deprecation messages (#335)' with the rest of Arrow libraries
- BUILD: error when merging 'Unify syntax for extracting inner values (#338)' on master branch
- BUILD: error when integrating 'Deprecate Hash (#337)' with the rest of Arrow libraries
- DOC: error when merging 'Make memoization compatible with MPP (#331)' on master branch HOT 1
- BUILD: error when merging 'Make memoization compatible with MPP (#331)' on master branch HOT 2
- BUILD: error when merging 'Make memoization compatible with MPP (#331)' on master branch
- BUILD: error when merging 'Make memoization compatible with MPP (#331)' on master branch HOT 2
- BUILD: error when integrating 'Publication: disable checksums for maven-metadata.xml (#354)' with the rest of Arrow libraries 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 arrow-core.