@@ -548,6 +548,15 @@ instance (Reflex t, Num a) => Num (Behavior t a) where
548548 negate = fmap negate
549549 signum = fmap signum
550550
551+instance (Num a, Reflex t) => Num (Dynamic t a) where
552+ (+) = liftA2 (+)
553+ (*) = liftA2 (*)
554+ abs = fmap abs
555+ signum = fmap signum
556+ fromInteger = pure . fromInteger
557+ negate = fmap negate
558+ (-) = liftA2 (-)
559+
551560instance (Reflex t, Semigroup a) => Semigroup (Behavior t a) where
552561 a <> b = pull $ liftM2 (<>) (sample a) (sample b)
553562 sconcat = pull . fmap sconcat . mapM sample