on develop help sign in
Add NotReady
ebff8c6Ali Abrar
reflex-vty.cabal+1
@@ -12,6 +12,7 @@ cabal-version: >=1.10
12
12
13library
13library
14 exposed-modules: Reflex.Vty
14 exposed-modules: Reflex.Vty
15+ other-modules: Reflex.Spider.Orphans
15 build-depends:
16 build-depends:
16 base,
17 base,
17 dependent-sum,
18 dependent-sum,
src/Reflex/Spider/Orphans.hsnew file+17
@@ -0,0 +1,17 @@
1+{-# LANGUAGE FlexibleInstances #-}
2+{-# LANGUAGE MultiParamTypeClasses #-}
3+{-# OPTIONS_GHC -fno-warn-orphans #-}
4+module Reflex.Spider.Orphans where
5+
6+import Reflex
7+import Reflex.NotReady.Class
8+import Reflex.Spider.Internal
9+
10+-- TODO move this to reflex
11+instance NotReady (SpiderTimeline x) (SpiderHost x) where
12+ notReadyUntil _ = pure ()
13+ notReady = pure ()
14+
15+instance HasSpiderTimeline x => NotReady (SpiderTimeline x) (PerformEventT (SpiderTimeline x) (SpiderHost x)) where
16+ notReadyUntil _ = pure ()
17+ notReady = pure ()
src/Reflex/Vty.hs+4
@@ -1,4 +1,5 @@
1{-# LANGUAGE FlexibleContexts #-}
1{-# LANGUAGE FlexibleContexts #-}
2+{-# LANGUAGE FlexibleInstances #-}
2{-# LANGUAGE LambdaCase #-}
3{-# LANGUAGE LambdaCase #-}
3{-# LANGUAGE MultiParamTypeClasses #-}
4{-# LANGUAGE MultiParamTypeClasses #-}
4{-# LANGUAGE RankNTypes #-}
5{-# LANGUAGE RankNTypes #-}
@@ -27,6 +28,8 @@ import Data.Maybe (catMaybes)
27
28
28import Reflex
29import Reflex
29import Reflex.Host.Class
30import Reflex.Host.Class
31+import Reflex.NotReady.Class
32+import Reflex.Spider.Orphans ()
30import qualified Graphics.Vty as V
33import qualified Graphics.Vty as V
31
34
32-- | The output of a 'VtyApp'.
35-- | The output of a 'VtyApp'.
@@ -49,6 +52,7 @@ type VtyApp t m =
49 , Ref m ~ IORef
52 , Ref m ~ IORef
50 , Ref (HostFrame t) ~ IORef
53 , Ref (HostFrame t) ~ IORef
51 , MonadRef (HostFrame t)
54 , MonadRef (HostFrame t)
55+ , NotReady t (PerformEventT t m)
52 )
56 )
53 => Event t (V.Event)
57 => Event t (V.Event)
54 -- ^ Vty input events.
58 -- ^ Vty input events.