on develop help sign in
Added IsString instance for Dynamic
commited4d6bfebfb5ee6d55295d19c6e28f50aab9df61 authorTom Smalley <tfsmalley@gmail.com> dateSun 1 Oct 2017, 07:35 (9 years ago) parent916c876
1 file changed+3
src/Reflex/Class.hs+3
src/Reflex/Class.hs+3
@@ -806,6 +806,9 @@ switcher :: (Reflex t, MonadHold t m)
806806 => Behavior t a -> Event t (Behavior t a) -> m (Behavior t a)
807807switcher b eb = pull . (sample <=< sample) <$> hold b eb
808808
809+instance (Reflex t, IsString a) => IsString (Dynamic t a) where
810+ fromString = pure . fromString
811+
809812-- | Combine two 'Dynamic's. The result will change whenever either (or both)
810813-- input 'Dynamic' changes. Equivalent to @zipDynWith (,)@.
811814zipDyn :: Reflex t => Dynamic t a -> Dynamic t b -> Dynamic t (a, b)