I'm trying to call the navigator.geolocation.getCurrentPosition
javascript function from purescript, but I've come across two problems.
In javascript it would be called using something like
navigator.geolocation.getCurrentPosition(function(position) { ... });
where position is an object.
Firstly, I don't know what the return type should be as it doesn't return anything, but instead calls a callback.
Secondly, I don't know what type to use for the callback, as the function can't be pure as it's result won't be returned.
So far I have
foreign import geolookup "function (callback) {\
navigator.geolocation.getCurrentPosition(callback);
\}" :: forall eff a. Eff (geolookup :: GeoLookup | eff) {}
geolookup \position -> ...
So here my type signature for the foreign function is forall eff a. Eff (geolookup :: GeoLookup | eff) {}
, however I know there should be a callback paramter in there too before the Eff. I'm just not sure how to write the type signature or implement it.