I am trying to import the following JavaScript function into PureScript using the FFI:
function getGreeting() {
return "Hi, welcome to the show."
}
but I am not sure what the type should be. The closest I get to is something like:
foreign import getGreeting :: Unit -> String
I do want getGreeting
to stay a function, and not convert it to a constant.
Is there a better way to write the type? I tried to see what PureScript does if I define a dummy function in PureScript itself with that type of signature:
var getGreeting = function (v) {
return "Hi, welcome to the show.";
};
Is there a way to get rid of that v
parameter that is not being used?
TIA
getGreeting :: forall eff. Eff (SOME_EFFECT | eff) String
. – paluhgetGreeting
because it is not my source code and should be considered unchangeable for now :) Also there are no side effects, so having theEff
type is undesirable. – Rouan van Dalen