Comments (7)
const curry = <Fn extends F.Function>(fn: Fn): F.Curry<Fn> => {
// your curry stuff
}
from ts-toolbelt.
Unfortunately, the type inference cannot work this way when it is curried. And there's also a few limitations with currying and generics (which should solve in the future microsoft/TypeScript#5453).
from ts-toolbelt.
The curry types from this library are already shipped with ramda. Make sure you have TS >= 3.5 and the latest @types/ramda
in your package.json
:)
from ts-toolbelt.
@pirix-gh Thanks a lot for your reply.
I test ramda map curry function, It is always error with x unknown.
@types/ramda
is lastest version
dependencies
"@types/ramda": "^0.26.19"
"typescript": "^3.5.3"
"ramda": "^0.26.1"
I have look into @types/ramda
map's type, it look right. Is it typescript limit? Or there is some thing can workaround?
from ts-toolbelt.
You must be new to typescript. I guess that you missed out:
R.map((x: number) => x + 1)([1,2,3])
But this is not related to this library ;)
Cheers
from ts-toolbelt.
@pirix-gh Ya, I just want to can I use ts-toolbelt let typescript know the x
type in curry function automatically .
Because this work
R.map(x => x + 1, [1,2,3]); // x is number auto
from ts-toolbelt.
@pirix-gh Thank you so much! I get it. 😀
from ts-toolbelt.
Related Issues (20)
- Documentation needs to have examples HOT 1
- Unreadable documentation du to contrast issues HOT 2
- U.Merge adds unexpected index signatures when applied to intersection types
- Dark theme is too hard to read code. HOT 4
- Namespace for testing related types
- Any.Compute changes empty tuple type
- String.StartsWith?
- Custom merge types
- Exact Object HOT 3
- request: retheme the documentation
- Object.Paths broken with TS 4.9 HOT 8
- O.Merge with nested objects should compute.
- OptionalDeep<any> shows an error
- Update syntax highlighting colors for docs HOT 2
- A/Any namespace doesn't export "If" type
- deprecate `Narrow` type
- `Update` doesn't work when attempting to make keys non-nullable
- Create a new docs website HOT 3
- Incorrect Optional (Patch?) results on types which look like Error
- Flexible export
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 ts-toolbelt.