Skip to content

Commit 85552b5

Browse files
committed
small fixes to arrays
1 parent a0d750d commit 85552b5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

JavaScript/TypedArray.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import Data.Word
4444
import Data.Int
4545
import Data.Coerce
4646
import Data.Primitive.ByteArray (ByteArray (..))
47+
import Data.JSString (unpack')
4748
import Foreign.C.Types
4849
import Unsafe.Coerce (unsafeCoerce)
4950

@@ -86,7 +87,7 @@ unsafeDataView' byteOffset mbyteLength (SomeArrayBuffer b) =
8687
-----------------------------------------------------------------------------
8788

8889
instance Show (SomeTypedArray m t) where
89-
show = show . js_show
90+
show = unpack' . js_show
9091

9192

9293

jsbits/array.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
function h$fromArray(a) {
88
var r = HS_NIL;
99
for(var i=a.length-1;i>=0;i--) r = MK_CONS(MK_JSVAL(a[i]), r);
10-
return a;
10+
return r;
1111
}
1212

1313
/*
@@ -19,7 +19,7 @@ function h$fromArray(a) {
1919
function h$fromArrayNoWrap(a) {
2020
var r = HS_NIL;
2121
for(var i=a.length-1;i>=0;i--) r = MK_CONS(a[i], r);
22-
return a;
22+
return r;
2323
}
2424

2525
/*

0 commit comments

Comments
 (0)