Remove accessing PureScript data model internals from JS
Closed this issue · 1 comments
As pointed out in #4, accessing PureScript data model internals (ie value0 property) is not recommended. This API is not officially supported and might change.
Doing it the right way would mean converting PS values to primitive values (and back) on PS side.
However, that would introduce significant boilerplate and possibly reduce performance.
Yeah, I'd definitely suggest not relying on PureScript representations for things - we usually deal with it by adding additional parameters to the FFI functions so it accepts functions that work as accessors/constructors for the types they're operating on. In the case of an FFI function that can accept different types of arguments (or no arguments / with arguments) we sometimes have multiple bindings for the function.