Skip to content

Commit

Permalink
export toList and use it in benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
sebfisch committed Nov 14, 2010
1 parent 22dbe58 commit 6eb2dc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Control/Monad/Stream.hs
Expand Up @@ -24,7 +24,7 @@
-- are interpreted as a multiset, i.e., a valid transformation
-- according to the monad laws may change the order of the results.
--
module Control.Monad.Stream ( Stream, suspended, runStream ) where
module Control.Monad.Stream ( Stream, suspended, runStream, toList ) where

import Control.Monad
import Control.Applicative
Expand Down Expand Up @@ -58,7 +58,7 @@ suspended = Susp
--
runStream :: Stream a -> [a]
runStream = toList
{-# DEPRECATED runStream "use Data.Foldable.toList" #-}
{-# DEPRECATED runStream "use toList" #-}

instance Monad Stream
where
Expand Down
4 changes: 2 additions & 2 deletions src/benchmarks.hs
Expand Up @@ -4,8 +4,8 @@ import Control.Monad.Stream

main :: IO ()
main = defaultMain
[ bench "permsort" $ nf (runStream . permSort) ([1..4]++[8,7..5]),
bench "8 queens" $ nf (runStream . nQueens) 8 ]
[ bench "permsort" $ nf (toList . permSort) ([1..4]++[8,7..5]),
bench "8 queens" $ nf (toList . nQueens) 8 ]

permSort :: [Int] -> Stream [Int]
permSort xs = do ys <- permute xs
Expand Down

0 comments on commit 6eb2dc0

Please sign in to comment.