lundi 17 novembre 2014

Why does `changes` return `Event t (Future a)`


Vote count:

0




The changes function has type Frameworks t => Behavior t a -> Moment t (Event t (Future a)). Future is abstract and there is only one function that consumes it (reactimate').


However, I can easily write the following function:



changes' :: Frameworks t => Behavior t a -> Moment t (Event t a)
changes' b = fmap (fmap const b <@>) (changes b)


to get a normal (non-Future) event.


Is something wrong with that function? If not, why does the original changes function have a more restrictive type?



asked 34 secs ago







Why does `changes` return `Event t (Future a)`

Aucun commentaire:

Enregistrer un commentaire