I'm trying to build JS FFI for some JS library to get it work with GHCJS and I need to convert list to single JSVal
listToJSVal :: PToJSVal a => [a] -> JSVal
listToJSVal = map pToJSVal
but get error
Couldn't match type ‘[JSVal]’ with ‘JSVal’
Expected type: [a] -> JSVal
Actual type: [a] -> [JSVal]
obviously, I need concat function, but using mconcat
gives
Could not deduce (Monoid JSVal) arising from a use of ‘mconcat’
from the context (PToJSVal a)
bound by the type signature for
Maybe, there is easier way how to do this conversion properly?