|
|
|
|
|
by megapoliss
1629 days ago
|
|
Curring is a way to do "dependency injection" in FP, so it let you to "capture" some arguments and don't pass them each time. Sure, arguments order matter, but you don't need to refactor that often. I'm not familiar enough with clojure, buy in F# you sample with collision/shake/police may looks like someGameState
|> handleCollisions
|> handleShake
|> handlePolice
...
|> renderGameState
where each function accept gameState, run some login against it, and return modified state, so you don't need to pass dozen arguments through call-stack. |
|