4 ms·
Having 3 dependencies is pretty typical. The dependencies may have their own dependencies too. The special thing about F# is a partial function application tha
by codedokode 10y ago
Having 3 dependencies is pretty typical. The dependencies may have their own dependencies too.
The special thing about F# is a partial function application that is probably missing in C#.
- daxfohl 10y agoI like the idea of partial application, but in practice I often find it more trouble than it's worth. I find myself spending too much time worrying about "which order to declare function params to allow for greatest utilization of partial application in these different contexts", which ultimately is orthogonal to "write this function, call this function, check in my code", and often makes the code's intention less apparent rather than moreso. I like it in certain purely functional data crunching routines, where it is idiomatic and can often make the code more generic and more intentional, but I've never had much luck doing DI this way. YMMV.
- Roboprog 10y agoIn case of emergency, break glass :-) Wrong language, but here is an example of a mechanism to partially apply the trailing arguments, rather than the more customary leading arguments: http://ramdajs.com/docs/#partialRight http://ramdajs.com/docs/#partialRight And finally, if something in the middle is the thing that needs to be nailed down, you can simply write a one liner function to provide the fixed thing and pass in the rest. (not really PFA any more at that point, but it will get the job done)