Closed mikesol closed 4 years ago
Did a bit of digging - the issue is because the transpiler translates this line: https://github.com/purescript/purescript-ordered-collections/blob/54af8b281bf01acfc14e147debec76974901e93c/src/Data/Set.purs#L176:
then case compare (ls `Array.unsafeIndex` l) (rs `Array.unsafeIndex` r) of
into
boxed v = Data_Ord::compare()(dictOrd)(ls::l())(rs::r());
whereas it should be something like
boxed v = Data_Ord::compare()(dictOrd)(Data_Array::unsafeIndex()(ls)(l))(Data_Array::unsafeIndex()(rs)(r));
Thanks for the report. The inliner is what is responsible for removing explicit calls to unsafeIndex. It looks like something is going wrong with it, though, and turning those local variables into module-level values.
Hi!
First off, thanks a lot for this great project.
I'm trying to compile something that uses Data.Set and hitting the following error:
I can't find
ls/ls.h
anywhere in the generated source or ffi. Is this part of an external library? Thanks!