transient-haskell / transient

A full stack, reactive architecture for general purpose programming. Algebraic and monadically composable primitives for concurrency, parallelism, event handling, transactions, multithreading, Web, and distributed computing with complete de-inversion of control (No callbacks, no blocking, pure state)
MIT License
631 stars 28 forks source link

Unbound variable n in tutorial #20

Closed ysangkok closed 8 years ago

ysangkok commented 8 years ago

In the last example on input elements, this line occurs:

r <- getRadio [fromStr v ++> setRadioActive v n | v <- ["red","green","blue"]]

But n is not defined anywhere...

geraldus commented 8 years ago

Looks like a typo, setRadioActive have only one argument:

setRadioActive
  :: (Typeable a, Eq a, Show a)
  => a -> Widget (Radio a)
ysangkok commented 8 years ago

I think the extra argument is there cause this definition from hplayground was used which is similar to this definition from MFlow.

agocorona commented 8 years ago

Thanks for the correction!

Yes this is because, in the latest version of GHCJS.HPlay I supressed the lambda expression coming from hplayground and MFlow, and I use a state variable to carry out the identifier of the radio buttons.