{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
#ifdef ghcjs_HOST_OS
{-# OPTIONS_GHC -Wno-dodgy-imports #-}
#endif
module Language.Javascript.JSaddle.String (
JSString
, textFromJSString
, textToJSString
, strToText
, textToStr
) where
import Data.Text (Text)
import Language.Javascript.JSaddle.Types (JSString(..))
#ifdef ghcjs_HOST_OS
import Data.JSString.Text (textFromJSString, textToJSString)
#endif
#ifndef ghcjs_HOST_OS
textFromJSString :: JSString -> Text
textFromJSString :: JSString -> Text
textFromJSString (JSString Text
text) = Text
text
textToJSString :: Text -> JSString
textToJSString :: Text -> JSString
textToJSString = Text -> JSString
JSString
#endif
strToText :: JSString -> Text
strToText :: JSString -> Text
strToText = JSString -> Text
textFromJSString
textToStr :: Text -> JSString
textToStr :: Text -> JSString
textToStr = Text -> JSString
textToJSString