I would like to write a module that uses a user-defined function. For instance:
module A (someFun) where someFun x = doSomethingWith externFun x
I would like externFun to be defined by the user in a file importing module A. Is there a way? Or is this just a bad idea?
Of course, I could pass externFun as an argument to someFun, but it doesnβt look very convenient there: the function passed will be the same for every call to someFun.
source share