Skip to content

Commit

Permalink
Deleted ListZipper' type-class, but kept MaybeListZipper data structu…
Browse files Browse the repository at this point in the history
…re. It is argued that `type MaybeListZipper a = Maybe (ListZipper a)` is more appropriate. I am not so sure, but that might be a future revision. All the tests were fixed such that they now compile.

This is to fix issue #2.
  • Loading branch information
tonymorris committed Sep 16, 2013
1 parent e3e3dc1 commit ec14f69
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 100 deletions.
4 changes: 3 additions & 1 deletion src/Monad/State.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import qualified Data.Foldable as F
-- $setup
-- >>> import Test.QuickCheck.Function
-- >>> import Data.List(nub)
-- >>> import Test.QuickCheck
-- >>> instance Arbitrary a => Arbitrary (List a) where arbitrary = P.fmap (foldr (:.) Nil) arbitrary

-- A `State` is a function from a state value `s` to (a produced value `a`, and a resulting state `s`).
newtype State s a =
Expand Down Expand Up @@ -135,7 +137,7 @@ findM =
--
-- /Tip:/ Use `findM` and `State` with a @Data.Set#Set@.
--
-- prop> case firstRepeat xs of Empty -> let xs' = foldRight (:) [] xs in nub xs' == xs'; Full x -> len (fiilter (== x) xs) > 1
-- prop> case firstRepeat xs of Empty -> let xs' = foldRight (:) [] xs in nub xs' == xs'; Full x -> len (filter (== x) xs) > 1
firstRepeat ::
Ord a =>
List a
Expand Down
Loading

0 comments on commit ec14f69

Please sign in to comment.