From c46a2749410c754db3cd021131ae664d3dc4818f Mon Sep 17 00:00:00 2001 From: Allen Nelson Date: Wed, 8 Nov 2017 16:49:48 -0600 Subject: [PATCH] export `getJSVal` from `Data.JSString` Since `JSString` is just a newtype wrapper, and because JS is unityped, `getJSVal` should always be safe (or at least no *less* safe than the way it was generated in the first place). Furthermore, being able to treat a `JSString` as a `JSVal` is often important in FFI code, as many JS functions can accept multiple "types" of values. The alternative is to use `unsafeCoerce` which is not super great. Also the function is defined but not used anywhere here or exported, so why not export it... --- Data/JSString.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Data/JSString.hs b/Data/JSString.hs index b3971dc..ecfd0d7 100644 --- a/Data/JSString.hs +++ b/Data/JSString.hs @@ -138,6 +138,9 @@ module Data.JSString ( JSString -- * Zipping , zip , zipWith + + -- * Coercion + getJSVal ) where import Prelude