
Should it be possible to write this: spinningTorusPair :: Double -> Behavior Geometry3 spinningTorusPair sz = uscale3 sz *% spinningG torusPair Instead of this: spinningTorusPair :: Double -> Behavior Geometry3 spinningTorusPair sz = (uscale3 sz *%) <$> spinningG torusPair That is, should a Behavior of something transformable be an instance of Transform as well? Has anyone tried to implement this instance? Thanks, Greg

Hi Greg,
I don't think anyone has implemented an instance for static transformations
of dynamic geometry. Ought to be easy, though. Also dynamic transformation
of static geometry and dynamic transformation of dynamic geometry. And the
corresponding three additional instances for 2D geometry. All six would be
very useful.
So I don't forget, would you please submit a ticket to either
http://trac.haskell.org/reactive or http://trac.haskell.org/FieldTrip ?
You might also enjoy adding these instances yourself. Patches are very
welcome.
Thanks, - Conal
On Mon, Nov 24, 2008 at 10:27 AM, Greg Fitzgerald
Should it be possible to write this:
spinningTorusPair :: Double -> Behavior Geometry3 spinningTorusPair sz = uscale3 sz *% spinningG torusPair
Instead of this:
spinningTorusPair :: Double -> Behavior Geometry3 spinningTorusPair sz = (uscale3 sz *%) <$> spinningG torusPair
That is, should a Behavior of something transformable be an instance of Transform as well? Has anyone tried to implement this instance?
Thanks, Greg _______________________________________________ Reactive mailing list Reactive@haskell.org http://www.haskell.org/mailman/listinfo/reactive

The instances would get added to the reactive-fieldtrip package. That
package is currently very small, but I anticipate lots of goodies going in
that relate to the combined use of Reactive and FieldTrip.
On Mon, Nov 24, 2008 at 11:18 AM, Conal Elliott
Hi Greg,
I don't think anyone has implemented an instance for static transformations of dynamic geometry. Ought to be easy, though. Also dynamic transformation of static geometry and dynamic transformation of dynamic geometry. And the corresponding three additional instances for 2D geometry. All six would be very useful.
So I don't forget, would you please submit a ticket to either http://trac.haskell.org/reactive or http://trac.haskell.org/FieldTrip ?
You might also enjoy adding these instances yourself. Patches are very welcome.
Thanks, - Conal
On Mon, Nov 24, 2008 at 10:27 AM, Greg Fitzgerald
wrote: Should it be possible to write this:
spinningTorusPair :: Double -> Behavior Geometry3 spinningTorusPair sz = uscale3 sz *% spinningG torusPair
Instead of this:
spinningTorusPair :: Double -> Behavior Geometry3 spinningTorusPair sz = (uscale3 sz *%) <$> spinningG torusPair
That is, should a Behavior of something transformable be an instance of Transform as well? Has anyone tried to implement this instance?
Thanks, Greg _______________________________________________ Reactive mailing list Reactive@haskell.org http://www.haskell.org/mailman/listinfo/reactive

static transformations of dynamic geometry. dynamic transformation of static geometry and dynamic transformation of dynamic geometry. And the corresponding three additional instances for 2D geometry. All six would be very useful.
Implementing just the dynamic transformation of dynamic geometry seems to work out best. instance Transform xf a => Transform (Behavior xf) (Behavior a) where (*%) = liftA2 (*%) With the other instances, GHC complains about ambiguities, and it's easy enough to pull either side up into the dynamic realm. Thanks, Greg

Ah, I didn't foresee those ambiguities, but now I see what you mean. I've
added your instance below (exactly how this sort of thing comes out for me
as well), used in Test.hs, and pushed & released reactive-fieldtrip-0.0.4.
And yeah, adding a 'pure' to promote static to dynamic is pretty easy.
Note that now Test.hs imports FRP.Reactive.FieldTrip (a new
collect/re-export module) instead of FRP.Reactive.FieldTrip.Adapter.
Thanks for the suggestion, Greg.
- Conal
On Mon, Nov 24, 2008 at 3:56 PM, Greg Fitzgerald
static transformations of dynamic geometry. dynamic transformation of static geometry and dynamic transformation of dynamic geometry. And the corresponding three additional instances for 2D geometry. All six would be very useful.
Implementing just the dynamic transformation of dynamic geometry seems to work out best.
instance Transform xf a => Transform (Behavior xf) (Behavior a) where (*%) = liftA2 (*%)
With the other instances, GHC complains about ambiguities, and it's easy enough to pull either side up into the dynamic realm.
Thanks, Greg

I've added your instance below (exactly how this sort of thing comes out for me as well), used in Test.hs, and pushed & released reactive-fieldtrip-0.0.4.
Cool, I updated my Bounce example to reactive-fieldtrip-0.0.4. It now bounces pairs of spinning torus pairs on left mouse clicks. Comments welcome. http://hpaste.org/12365 -Greg

Wow. What fun, Greg!! I really love this simple example.
I annotated your post with a tweaked version, to make the rotations
different and have opposite directions.
I can see there's a performance problem somewhere in reactive that's causing
the animation to slow down with more button clicks. Even worse, under ghci,
additional runs are slow from the start. I guess that means there are still
some running threads. Clearly some work to be done in the implementation.
- Cona
On Tue, Nov 25, 2008 at 10:10 AM, Greg Fitzgerald
I've added your instance below (exactly how this sort of thing comes out for me as well), used in Test.hs, and pushed & released reactive-fieldtrip-0.0.4.
Cool, I updated my Bounce example to reactive-fieldtrip-0.0.4. It now bounces pairs of spinning torus pairs on left mouse clicks. Comments welcome.
-Greg
participants (2)
-
Conal Elliott
-
Greg Fitzgerald