Hy, toolz and currying

Currying (or should we say Sch√∂nfinkelning as it was developed by Moses Sch√∂nfinkeln and then further developed by Haskell Curry or even Fregeling as Gottlob Frege originally introduced the idea), is technique of translating execution of function of multiple parameters into execution a sequence of functions taking a single parameter (thanks Wikipedia, I couldn’t figure out more succint way of saying that).

Continue reading

Currying in apocrita

While apocrita is very limited language, it’s already complete enough that I can experiment with ideas and see how they work in practice (or in this case, how to implement an old and well known idea). And that old idea is currying (technically partial application, but close enough).

In partial application the language will detect if a function is being called without enough parameters. Instead of throwing an error, a new function is created and returned. This new function captures all the parameters that were supplied to the original function and can be called either normally or partially applied again (if there are more than one parameter left).

Continue reading