on develop help sign in
Merge pull request #133 from tomsmalley/develop

Added IsString instance for Dynamic

commit25bd18d69d8a0c3bdbdaf9bd193beb9bbc1a55e9 authorRyan Trinkle <ryan.trinkle@gmail.com> dateSun 1 Oct 2017, 11:44 (9 years ago) parent916c876ed4d6bf
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)