inline-js icon indicating copy to clipboard operation
inline-js copied to clipboard

Allow code blocks into quasiquotes

Open qwbarch opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. In order to insert a Haskell type into the quasiquotes, I always have to make dummy values:

newtype Foo = Foo { unFoo :: ByteString }
let foo' = unFoo foo
[js|
  $foo // do something with foo
|]

Describe the solution you'd like It'd be nice to be able to unwrap the Foo within the quasiquotes:

[js|
  ${unFoo foo}
|]

Also, does this library support inserting a JSExpr to another JSExpr? Here is what I'd like to do:

let a = [js|const examplePackage = require("package")|]
    b =
     [js|
       $a
       // do more work using examplePackage
     |]

qwbarch avatar Jan 14 '22 21:01 qwbarch