2Module: Reflex.Class.Switchable
3Description: A class for things that can be switched on the firing of an event
5{-# LANGUAGE FlexibleInstances #-}
6{-# LANGUAGE FunctionalDependencies #-}
7{-# LANGUAGE MultiParamTypeClasses #-}
8{-# LANGUAGE UndecidableInstances #-}
9module Reflex.Class.Switchable where
14-- | Class representing things that can be switched when the provided event occurs
15class Reflex t => Switchable t w | w -> t where
16 switching :: MonadHold t m => w -> Event t w -> m w
18instance Reflex t => Switchable t (Event t a) where
19 switching = switchHold
21instance Reflex t => Switchable t (Dynamic t a) where
22 switching a e = fmap join $ holdDyn a e
24instance Reflex t => Switchable t (Behavior t a) where
27instance (Reflex t, Switchable t a, Switchable t b) => Switchable t (a, b) where
28 switching (a, b) e = (,)
29 <$> (switching a $ fmap fst e)
30 <*> (switching b $ fmap snd e)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list