ghcjs / ghcjs-base

base library for GHCJS for JavaScript interaction and marshalling, used by higher level libraries like JSC
MIT License
45 stars 67 forks source link

Switch JSArray to use a type family #10

Closed hamishmack closed 9 years ago

hamishmack commented 9 years ago

Arrays will be JSArray (JSRef a) instead of JSArray a. This means that the access phantom type a is not needed to make the array type.

The existing code in that uses JSArray JSString is a bit simpler.

hamishmack commented 9 years ago

I think a better idea is to use type JSArray a = JSRef [a]. This does make [a] a sort of default Haskell representation of an JavaScript array, but it does not prevent other type also being marshalled to JavaScript arrays.