[reactive] Re: Changed argument orders for snapshot etc

Conal Elliott conal at conal.net
Mon Dec 8 18:52:41 EST 2008


also whenE (in reactive-0.10.3).

On Mon, Dec 8, 2008 at 3:46 PM, Conal Elliott <conal at conal.net> wrote:

> I swapped the argument order for snapshot and a few other functions.  For
> instance,
>
>     -- old type
>     snapshot :: Event a -> Behavior b -> Event (a,b)
>
>     -- new type
>     snapshot :: Behavior b -> Event a -> Event (a,b)
>
> So that 'snapshot b' is an event transformer.  This change makes other
> operations work out nicely when partially applied.
>
> Take careful note of the argument and result orders.  I'm not sure what's
> most memorable.  I've kept to the convention that the additional info is in
> the second half of the result.  Also a bit odd:
>
>     snapshotWith :: (a -> b -> c) -> Behavior b -> Event a -> Event c
>
> The complete list of argument-swappedfns: snap, snapshot, snapshot_,
> snapRemainderE, splitE (watch out).
>
> Libraries affected: reactive, reactive-glut, reactive-fieldtrip.
>
>   - Conal
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/reactive/attachments/20081208/957bf046/attachment.htm


More information about the Reactive mailing list