Skip to content

Commit 7cbe128

Browse files
Syaiful Bahrijulienchan
authored andcommitted
add failing test for stack safety
1 parent 35fa90a commit 7cbe128

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/Main.purs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module Test.Main where
2+
3+
import Prelude hiding (discard)
4+
5+
import Control.Monad.Eff (Eff)
6+
import Control.Monad.Eff.Console (CONSOLE)
7+
8+
import Data.Foldable (class Foldable)
9+
import Data.List ((..))
10+
11+
import Pipes (each, for, (>->), discard)
12+
import Pipes.Core (runEffectRec, Pipe)
13+
import Pipes.Prelude as P
14+
15+
runDrain :: forall e f a. Foldable f => Pipe Int a (Eff e) Unit -> f Int -> (Eff e) Unit
16+
runDrain p v = runEffectRec $ for (each v >-> p) discard
17+
18+
main :: forall eff. Eff (console :: CONSOLE | eff) Unit
19+
main = runDrain (P.map (add 2)) (1..3000)

0 commit comments

Comments
 (0)