2{-# LANGUAGE DefaultSignatures #-}
3{-# LANGUAGE FlexibleContexts #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE FunctionalDependencies #-}
6{-# LANGUAGE MultiParamTypeClasses #-}
7{-# LANGUAGE TypeFamilies #-}
8{-# LANGUAGE UndecidableInstances #-}
9#ifdef USE_REFLEX_OPTIMIZER
10{-# OPTIONS_GHC -fplugin=Reflex.Optimizer #-}
12module Reflex.NotReady.Class
16import Control.Monad.Reader (ReaderT)
17import Control.Monad.Trans
18import Control.Monad.Trans.Writer (WriterT)
20import Reflex.BehaviorWriter.Base (BehaviorWriterT)
22import Reflex.DynamicWriter.Base (DynamicWriterT)
23import Reflex.EventWriter.Base (EventWriterT)
24import Reflex.Host.Class
25import Reflex.PerformEvent.Base (PerformEventT (..))
26import Reflex.PostBuild.Base (PostBuildT)
27import Reflex.Query.Base (QueryT)
28import Reflex.Requester.Base (RequesterT)
29import Reflex.TriggerEvent.Base (TriggerEventT)
31class Monad m => NotReady t m | m -> t where
32 notReadyUntil :: Event t a -> m ()
33 default notReadyUntil :: (MonadTrans f, m ~ f m', NotReady t m') => Event t a -> m ()
34 notReadyUntil = lift . notReadyUntil
37 default notReady :: (MonadTrans f, m ~ f m', NotReady t m') => m ()
38 notReady = lift notReady
40instance NotReady t m => NotReady t (ReaderT r m) where
41 notReadyUntil = lift . notReadyUntil
42 notReady = lift notReady
44instance (NotReady t m, Monoid w) => NotReady t (WriterT w m) where
45 notReadyUntil = lift . notReadyUntil
46 notReady = lift notReady
48instance NotReady t m => NotReady t (PostBuildT t m) where
49 notReadyUntil = lift . notReadyUntil
50 notReady = lift notReady
52instance NotReady t m => NotReady t (EventWriterT t w m) where
53 notReadyUntil = lift . notReadyUntil
54 notReady = lift notReady
56instance NotReady t m => NotReady t (DynamicWriterT t w m) where
57 notReadyUntil = lift . notReadyUntil
58 notReady = lift notReady
60instance NotReady t m => NotReady t (BehaviorWriterT t w m) where
61 notReadyUntil = lift . notReadyUntil
62 notReady = lift notReady
64instance NotReady t m => NotReady t (QueryT t q m) where
65 notReadyUntil = lift . notReadyUntil
66 notReady = lift notReady
68instance (ReflexHost t, NotReady t (HostFrame t)) => NotReady t (PerformEventT t m) where
69 notReadyUntil = PerformEventT . notReadyUntil
70 notReady = PerformEventT notReady
72instance NotReady t m => NotReady t (RequesterT t request response m) where
73 notReadyUntil = lift . notReadyUntil
74 notReady = lift notReady
76instance NotReady t m => NotReady t (TriggerEventT t m) where
77 notReadyUntil = lift . notReadyUntil
78 notReady = lift notReady
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