Comments (2)
Hi Johannes,
No need to qualify every request :) I have tried to document every function that I export but I understand that some high level documentation is missing -- but it's a little hard sometimes to see exactly what parts need more examples. So if you're having difficulties, just let me know and I'll try to fix it :) Feel free also to ping me on #haskell, I'm usually there (though perhaps not, as it happens, over the next week days as I'm travelling and working odd hours).
So it's a reasonable request and I'll make a note to add an example along the lines that you suggest. To answer your specific question: yes, your example is idiomatic, with one exception: if you call remotable
on a function f :: T1 -> T2
then
$(functionSDict 'f) :: Static (SerializableDict T1)
In your example you have a function compute :: Integer -> Process Integer
. call
needs a dictionary for the result of this process (Integer
), but you're passing the dictionary that was created for the process argument. It happens to work because in your case the argument happens to be of the same type as the result of the process (Integer
), but it would fail if, for instance, your function would have type isPrime :: Integer -> Process Bool
.
Now functionSDict
is for convenience only, and you can easily define your own serializable dictionaries:
sdictInteger :: SerializableDict Integer
sdictInteger = SerializableDict
$(mkStatic 'sdictInteger) :: Static (SerializableDict Integer)
but perhaps the case you cite is common enough to warrant a function functionTDict
such that if f :: T1 -> Process T2
then
$(functionTDict 'f) :: Static (SerializableDict T2)
I need to give that some thought, but I think I'll add that, and then add an example.
from distributed-process.
Hi Johannes,
I have added functionTDict and improved the documentation of C.D.P.Closure, and included a small self-contained example along the lines you suggested. Please reopen the issue the documentation is unclear.
Thanks for the report.
Edsko
from distributed-process.
Related Issues (20)
- Could not deduce (MonadFail Process) arising from a use of ‘fail’ HOT 1
- whereisRemoteAsync does not work via LAN HOT 1
- maintainance issue w.r.t. STM dependency & GHC version compatibility
- broken link in repo description HOT 3
- Generalize call to take a `Closure (SerializableDict a)`
- Revamp/Update CI
- Revamp CI on distributed-process
- Evaluate CI providers HOT 3
- Would it be possible to send and receive CH messages from potentially untrusted sources HOT 1
- Support for distributed traces
- Revamp docs site on distributed process
- Establish support window & upgrade plan
- Address Intermittently failing tests HOT 1
- Remove rematch dependency in distributed-process-tests HOT 1
- Build failure with ghc-9.2.4 `Expecting one more argument to ‘TyVarBndr’` HOT 2
- Can’t build with GHC 9.2.5 HOT 1
- No instance for (binary-0.8.5.1:Data.Binary.Class.Binary Main.Message) HOT 1
- New release? HOT 5
- Add LaurentRDC to the hackage maintainers list HOT 3
- Add davidsd and LaurentRDC to hackage maintainers list for `distributed-process-tests` 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 distributed-process.