0 | module LazyListT
 1 |
 2 | import Data.List.Lazy
 3 | import Control.Eff.Internal
 4 |
 5 | export
 6 | runLazyList :
 7 |   {auto _ : Has LazyList fs}
 8 |   -> Eff fs a
 9 |   -> Eff (fs - LazyList) (LazyList a)
10 | runLazyList xs =
11 |   case toView xs of
12 |     Pure val => pure (pure val)
13 |     Bind x g => case handle (id {a = LazyList _}) x of
14 |       Left y => lift y >>= runLazyList . g
15 |       Right ys => do
16 |         tmp <- Data.List.Lazy.traverse (runLazyList . g) ys
17 |         pure $ concat tmp
18 |