Experimenting with purescript-sdom, how do I have more effects?


I was playing around with https://github.com/paf31/purescript-sdom/blob/master/examples/async/src/Main.purs … and I think I kinda like the api. What would I like to know now, how would I have more effects?

I.e. in the async example, would it be possible to have to generate a random value every second, instead of incrementing/decrementing? Or to issue a get request? I am not sure because in the main declaration, there is just

main :: Eff ( dom :: DOM
            , exception :: EXCEPTION
            , frp :: FRP
            , ref :: REF
            ) Unit

and looking at api, it seems that it is SDOM all the way down and no place to add more effects.
Am I missing something?

The rank-n type within the SDOM constructor (https://github.com/paf31/purescript-sdom/blob/master/src/SDOM.purs#L99) disallows any other effects, so it’s not currently possible to use other effects without resorting to unsafeCoerceEff. If SDOM is updated to use Effect for 0.12 it won’t matter, though.