Comments (5)
The law holds provided (a) you only look at the results of runHaxl
and (b) your data sources satisfy the property that fetching in parallel gives the same result as fetching sequentially.
So Haxl stretches the law a bit, but doesn't break it.
from haxl.
I have updated code snippets to match ones from your slides and in that example (when performing side effective actions) it ignores that law. Is it common to obey laws for partial input like this in haskell?
from haxl.
Is it common to obey laws for partial input like this in haskell?
I don't fully understand the question. Perhaps if you give me a specific example of what you mean by partial input?
from haxl.
You said that Haxl is lawful if "your data sources satisfy the property that fetching in parallel gives the same result" so it's not lawful for all other possible use cases of Haxl(is partially lawful), for example for this fragment of Haxl it's not lawful as 1
and 2
have different results:
run $ do -- 1
cmd "touch" ["foo"]
cmd "rm" ["foo"]
run $ do -- 2
_ <- cmd "touch" ["foo"]
cmd "rm" ["foo"]
from haxl.
Right - the cmd
data source doesn't satisfy the property, so when used with that data source Haxl doesn't obey the monad laws.
It's still possible to use Haxl under these conditions, but you have to know what you're doing. Be aware of when <*>
is being used, and don't use ApplicativeDo
.
from haxl.
Related Issues (20)
- 2.1.*.0 tags and Hackage release HOT 1
- Building Error HOT 1
- Plans for a monad transformer interface? HOT 1
- New version to Hackage for GHC 8.8 and beyond HOT 3
- DataCacheTest fails to build with executable profiling enabled
- Release version compatible with aeson-2 and GHC 9 HOT 2
- Adding MonadMask instance HOT 1
- Rename Show1 to ShowP HOT 2
- This package is not licensed under BSD3 HOT 2
- haxl failing to compile with ghc-8.2 rc2 HOT 6
- Memory consumption depending on type annotation HOT 3
- Non-deterministic failure in collectsdata test
- Haxl 2 release on Hackage HOT 3
- Broken Hackage links HOT 1
- 2.0.0.0 tag is missing. HOT 1
- No way to update or invalidate cache HOT 9
- Don't rely on `Show` to be valid Haskell code HOT 4
- Inaccurate lower bound on `base`
- tight upper bounds for ghc-8.6.1 HOT 1
- runHaxl stuck 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 haxl.