@@ -11,20 +11,15 @@ module Ace.Halogen.Component
11
11
12
12
import Prelude
13
13
14
- import Control.Coroutine (Producer )
15
- import Control.Coroutine.Aff as CCA
16
- import Control.Coroutine.Stalling as SCR
17
14
import Control.Monad.Aff (Aff , runAff )
18
15
import Control.Monad.Aff.AVar (AVAR )
19
16
import Control.Monad.Aff.Free (class Affable )
20
17
import Control.Monad.Eff (Eff )
21
18
import Control.Monad.Eff.Now (NOW , now )
22
19
import Control.Monad.Eff.Random (random , RANDOM )
23
20
import Control.Monad.Eff.Ref (Ref , REF , readRef , writeRef , modifyRef )
24
- import Control.Monad.Free.Trans (hoistFreeT )
25
21
26
22
import Data.DateTime.Instant (unInstant )
27
- import Data.Either (Either (..))
28
23
import Data.Foldable (traverse_ )
29
24
import Data.Maybe (Maybe (..), maybe )
30
25
import Data.StrMap (StrMap )
@@ -44,7 +39,6 @@ import DOM.HTML.Types (HTMLElement)
44
39
import Halogen as H
45
40
import Halogen.HTML.Indexed as HH
46
41
import Halogen.HTML.Properties.Indexed as HP
47
- import Halogen.Query.EventSource as HES
48
42
49
43
-- | Effectful knot of autocomplete functions. It's needed because
50
44
-- | `languageTools.addCompleter` is global and adds completer to
@@ -215,7 +209,7 @@ eval setup resume = case _ of
215
209
setAutocompleteResume resume editor
216
210
Editor .onFocus editor $ writeRef focused key
217
211
session <- H .fromEff $ Editor .getSession editor
218
- H .subscribe $ eventSource_ (Session .onChange session) do
212
+ H .subscribe $ H . eventSource_ (Session .onChange session) do
219
213
pure $ H .action TextChanged
220
214
H .liftH $ setup editor
221
215
pure next
@@ -255,26 +249,6 @@ eval setup resume = case _ of
255
249
256
250
TextChanged next -> pure next
257
251
258
- -- TODO: when Halogen's eventSource_ / produce is fixed to use Affable rather
259
- -- than MonadAff, these can be removed.
260
- eventSource_
261
- :: forall eff f g
262
- . (Monad g , Affable (avar :: AVAR | eff ) g )
263
- => (Eff (avar :: AVAR | eff ) Unit -> Eff (avar :: AVAR | eff ) Unit )
264
- -> Eff (avar :: AVAR | eff ) (f Unit )
265
- -> HES.EventSource f g
266
- eventSource_ attach handle =
267
- HES.EventSource $
268
- SCR .producerToStallingProducer $ produce \emit ->
269
- attach (emit <<< Left =<< handle)
270
-
271
- produce
272
- :: forall a r m eff
273
- . (Functor m , Affable (avar :: AVAR | eff ) m )
274
- => ((Either a r -> Eff (avar :: AVAR | eff ) Unit ) -> Eff (avar :: AVAR | eff ) Unit )
275
- -> Producer a m r
276
- produce = hoistFreeT H .fromAff <<< CCA .produce
277
-
278
252
-- | A convenience function for creating a `SlotConstructor` for an Ace
279
253
-- | component.
280
254
aceConstructor
0 commit comments