Open stain opened 3 months ago
Thanks for the report, I've added a install statement for the morloc
module conventions
to the Dockerfile. I should probably include that module in the base morloc
container, but adding it here should fix the problem.
Reopening. You worded your question very clearly but I clearly didn't read it properly. I'll get back with you in a moment.
You can address the current error by installing the conventions
module with morloc install conventions
.
But after installation, I suspect you will hit a second error. This is an old example from before I added typeclasses. Back then, there was just one mul
function that multiplied integers. Now mul
is one function in a typeclass that includes instances for the integer and real types. But the compiler does not know which function the user wants. So you will need to add a top-level signature for each function, as below:
module sos (*)
import cppbase
square :: Real -> Real
square x = mul x x
sumOfSquares :: [Real] -> Real
sumOfSquares xs = fold add 0.0 (map square xs)
I will clarify all this in the README.
I can't run the second example in the README as I get an error: