4 ms·
And then you actually try to write it in a functional language, and end up with something like: cake = map (cool . bake 30 175) . splitIntoPans $ mix [ butter,
by antisemiotic 7y ago
And then you actually try to write it in a functional language, and end up with something like:
cake = map (cool . bake 30 175) . splitIntoPans $ mix [ butter, sugar, walnuts ]
- p33p 7y agoI think partial application and pipe operators make this so very intuitive though: [butter, sugar, walnuts] |> mix() |> splitIntoPans(pans = 3) |> bake(time = 30, temp = 175) |> cool(time = 5)
- strangenessak 7y agoWe can improve the syntax further [butter, sugar, walnuts] mix() splitIntoPans(pans = 3) bake(time = 30, temp = 175) cool(time = 5) Hmm, wait a second.....
- pkilgore 7y ago[butter, sugar, walnuts] ^^^ Somewhere wanted type CakeIngredients but missing record field "Flour" If imperative style programming came with type inference on the level of the Ocaml compiler sign me up. For now, though, I can spare a few cycles in exchange for correct programs.
- antisemiotic 7y agoCareful, somewhere along that line you might even come to a conclusion that Haskell is world's most advanced imperative language, with the reprogrammable semicolons and whatnot.
- twic 7y agoOr, to coin a phrase: https://apps.dtic.mil/dtic/tr/fulltext/u2/a030751.pdf https://apps.dtic.mil/dtic/tr/fulltext/u2/a030751.pdf
- meijer 7y agoBut this doesn't handle the state. It is not working imperativ code.