Comments (6)
Aldwin, I believe it's worth considering once more the possibility of defining and exporting FutureType :: Type -> Type -> Type
. Error messages could then reference URLs such as https://github.com/Avaq/Fluture/tree/5.0.0#FutureType
.
from fluture.
I see how exporting a FutureType
seems more convenient for users who wish to inter-operate with Sanctuary but consider my thoughts:
- Adding a large library such as
sanctuary-def
may not be justified for such a small and likely not often used feature, but more importantly; - There is no way for me to know whether types created by def 0.8 are compatible with types created by def 0.9 (or whatever, it even might break with minor releases). Therefore my
FutureType
may work with Sanctuary 0.11, but not 0.12. If I would update mysanctuary-def
, I might remove compatibility with older Sanctuary versions. This "documentation" approach assumes that thesanctuary-def
public API will undergo fewer changes than thesanctuary-def
internals with every new release. It enables the user to choose whichsanctuary-def
version to use to define theirFutureType
. The alternative would beFutureType :: Def -> Type -> Type -> Type
but that doesn't account for stuff like the added arguments that triggered this issue.
Looking at these points, I would be inclined to think that the documentation approach I'm currently using is the best option I have. I think I should keep the documentation up-to-date with the latest version of sanctuary-def
and have users figure out what to do if they need to define their type with a different version.
from fluture.
Good points, Aldwin. You've convinced me. :)
It would be really nice if the correctness of the code examples were verified as part of the test suite, but this is likely to be more trouble than it's worth.
from fluture.
After writing about it in the issue above, I realized I may add sanctuary-def
under peerDependencies
, and try
to require
it, and export the type if
I was able to load sanctuary-def
.
from fluture.
It does reduce flexibility a little bit though. Suddenly a user is bound to the range of versions of sanctuary-def
where the API of BinaryType
stayed the same, whereas with the readme on the side, they can make the appropriate adjustments to use their favorite version of sanctuary-def
. Hmm..
from fluture.
I may add
sanctuary-def
underpeerDependencies
This sounds like a good idea.
export the type
if
I was able to loadsanctuary-def
My initial reaction is negative, as conditional exports could be surprising. I can see the convenience, though.
It does reduce flexibility a little bit though.
The right approach is not obvious.
from fluture.
Related Issues (20)
- Error in readme HOT 4
- Can`t realize ap composition HOT 6
- Is it proven that Fluture Future is lawful? HOT 4
- Access computation value as return value HOT 3
- Why does encaseP / attemptP accepts only one parameter? HOT 4
- Event Streams handling HOT 5
- Any future for Fluture on React Native? HOT 4
- chainRej example doesn't include all code needed to replicate
- Consider preserving the specific Error sub-type when converting to Promise HOT 5
- Why not thenables? HOT 3
- Example Sanctuary integration code throws an error
- Unable to infer types in function passed to `map` HOT 13
- Investigate option for alternative debug api
- Make typings for algebras more strict
- It seams like `Hook (Future e a) b` is equivalent to `ContT a (Future e) b` HOT 1
- Add Future.assume?
- Async Iterators HOT 4
- Using Fluture with Jest HOT 1
- TypeScript error using map HOT 4
- Use result of Future
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 fluture.