Skip to content

Commit d3874aa

Browse files
committed
Updates for 0.7
1 parent fc7145a commit d3874aa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

examples/Collatz.purs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module Main where
22

3+
import Prelude
4+
35
import Data.Tuple
46
import Data.Maybe
57
import Data.Array
@@ -8,7 +10,7 @@ import Data.Int
810

911
import Console
1012

11-
collatz :: Int -> [Int]
13+
collatz :: Int -> Array Int
1214
collatz = unfoldr step
1315
where
1416
step n | n == one = Nothing

src/Data/Unfoldable.purs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
module Data.Unfoldable where
88

9+
import Prelude
10+
911
import Data.Maybe
1012
import Data.Tuple
1113
import Data.Array.ST
@@ -23,7 +25,7 @@ import Control.Monad.ST
2325
class Unfoldable t where
2426
unfoldr :: forall a b. (b -> Maybe (Tuple a b)) -> b -> t a
2527

26-
instance unfoldableArray :: Unfoldable [] where
28+
instance unfoldableArray :: Unfoldable Array where
2729
unfoldr f b = runPure (runSTArray (do
2830
arr <- emptySTArray
2931
seed <- newSTRef b

0 commit comments

Comments
 (0)