on develop help sign in
Remove Switchable since it's unused
commitb7f7b18a20181d48e9499765b5ec0a54332d96de authorAli Abrar <aliabrar@gmail.com> dateFri 26 Mar 2021, 02:03 (6 years ago) parent8ad5861
2 files changed−28
reflex-vty.cabal−1 src/Reflex/Class/Switchable.hs−27
reflex-vty.cabal−1
@@ -31,7 +31,6 @@ library
3131 , Reflex.Vty.Widget.Split
3232 , Reflex.Vty.Widget.Text
3333 , Data.Text.Zipper
34− , Reflex.Class.Switchable
3534 , Reflex.Spider.Orphans
3635 , Control.Monad.NodeId
3736 build-depends:
src/Reflex/Class/Switchable.hsdeleted−27
@@ -1,27 +0,0 @@
1−{-|
2−Module: Reflex.Class.Switchable
3−Description: A class for things that can be switched on the firing of an event
4−-}
5−{-# Language UndecidableInstances #-}
6−module Reflex.Class.Switchable where
7−
8−import Control.Monad
9−import Reflex
10−
11−-- | Class representing things that can be switched when the provided event occurs
12−class Reflex t => Switchable t w | w -> t where
13− switching :: MonadHold t m => w -> Event t w -> m w
14−
15−instance Reflex t => Switchable t (Event t a) where
16− switching = switchHold
17−
18−instance Reflex t => Switchable t (Dynamic t a) where
19− switching a e = fmap join $ holdDyn a e
20−
21−instance Reflex t => Switchable t (Behavior t a) where
22− switching = switcher
23−
24−instance (Reflex t, Switchable t a, Switchable t b) => Switchable t (a, b) where
25− switching (a, b) e = (,)
26− <$> switching a (fmap fst e)
27− <*> switching b (fmap snd e)