You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Data.JSString.pack gives incorrect results. For example:
importData.JSString (pack)
main::IO()
main =print$ pack $fst$foldr (select (=='a')) ([], []) "ababababa"-- "a"where-- taken from Data.OldList
select p x ~(ts, fs) | p x = (x:ts, fs )
|otherwise= (ts , x:fs)
Outputs "a", and it should output "aaaaa". But if we remove the ~ for irrefutable patterns, we get correct results:
importData.JSString (pack)
main::IO()
main =print$ pack $fst$foldr (select (=='a')) ([], []) "ababababa"-- "aaaaa"where-- taken from Data.OldList
select p x (ts, fs) | p x = (x:ts, fs )
|otherwise= (ts , x:fs)
I believe this issue has something to do with GHCJS packing the lazy String too early, before the fold is complete.
Using
Data.JSString.pack
gives incorrect results. For example:Outputs "a", and it should output "aaaaa". But if we remove the
~
for irrefutable patterns, we get correct results:I believe this issue has something to do with GHCJS packing the lazy String too early, before the fold is complete.
/cc @eskimor @luite
The text was updated successfully, but these errors were encountered: