John Bugner
2017-11-25 17:34:48 UTC
In Elm 0.17, signals were removed, and subscriptions were added. Evan says
I agree! Thinking about my program in terms of MVU (model, view, update) is
easier than trying to put together a signal graph. I'm told that this
change broke things like back-in-time debugging, but I don't know why. Why
is it not possible anymore? It seems that subscriptions grew out of this
successful experiment
( https://github.com/evancz/start-app/blob/master/src/StartApp.elm ) to
find a way to simplify programming with signals.
Let's compare the signatures of the 'Program' types ('Config' in
'view' and 'subscriptions'/'inputs' are different. 'view' lost a parameter,
and 'subscriptions' gained a parameter. The magic difference that lost us
BiT debugging must be in there, right? I recall reading that BiT debugging
was only possible when the signal graph was static. Wouldn't this
correspond to 'subscriptions' gaining a parameter? (and thus becoming
dynamic?) and about 'view', why did it have/need a 'Signal.Address action'
parameter?
I guess my question is: wouldn't it have been possible to make Elm use the
MVU model, but still allow BiT debugging? (Basically keep using the
StartApp package?) If so, why then was FRP abandoned?
That is all nice, but the big benefit is that Elm is now significantly
easier to learn and use.I agree! Thinking about my program in terms of MVU (model, view, update) is
easier than trying to put together a signal graph. I'm told that this
change broke things like back-in-time debugging, but I don't know why. Why
is it not possible anymore? It seems that subscriptions grew out of this
successful experiment
( https://github.com/evancz/start-app/blob/master/src/StartApp.elm ) to
find a way to simplify programming with signals.
Let's compare the signatures of the 'Program' types ('Config' in
type alias Config model action =
{ init : (model, Effects action)
, update : action -> model -> (model, Effects action)
, view : Signal.Address action -> model -> Html
, inputs : List (Signal.Signal action)
}
{ init : (model, Cmd msg)
, update : msg -> model -> (model, Cmd msg)
, subscriptions : model -> Sub msg
, view : model -> Html msg }
}
-> Program Never model msg
They look pretty similar! 'init' is the same. 'update' is the same. But{ init : (model, Effects action)
, update : action -> model -> (model, Effects action)
, view : Signal.Address action -> model -> Html
, inputs : List (Signal.Signal action)
}
{ init : (model, Cmd msg)
, update : msg -> model -> (model, Cmd msg)
, subscriptions : model -> Sub msg
, view : model -> Html msg }
}
-> Program Never model msg
'view' and 'subscriptions'/'inputs' are different. 'view' lost a parameter,
and 'subscriptions' gained a parameter. The magic difference that lost us
BiT debugging must be in there, right? I recall reading that BiT debugging
was only possible when the signal graph was static. Wouldn't this
correspond to 'subscriptions' gaining a parameter? (and thus becoming
dynamic?) and about 'view', why did it have/need a 'Signal.Address action'
parameter?
I guess my question is: wouldn't it have been possible to make Elm use the
MVU model, but still allow BiT debugging? (Basically keep using the
StartApp package?) If so, why then was FRP abandoned?
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.