foreign import subscribeEventedOnPrime
"function subscribeEventedOnPrime(n){ \
\ return function(fn){ \
\ return function(obj){ \
\ return function(){ \
\ obj.addEventListener(n, fn); \
\ return obj; \
\ }; \
\ }; \
\ }; \
\}" :: forall d a o eff.
String ->
(d -> a) ->
o ->
Eff (customEvent :: CustomEvent | eff) o
subscribeEventedOn n f o = subscribeEventedOnPrime n (\e -> do
trace "wtf" -- if this line is removed, everything seems to work
f $ newEvent e."type" e."detail"
) o
do 块是否有一行与多行,似乎影响该代码是否实际被调用。我错过了什么?