Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
retronym committed Apr 22, 2010
1 parent 9d484d4 commit 26455f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/src/main/scala/scalaz/Scalaz.scala
Expand Up @@ -138,8 +138,11 @@ object Scalaz extends ScalazLow

implicit def MapEntryMA[X, A](e: Entry[X, A]): MA[PartialApply1Of2[Entry, X]#Apply, A] = ma[PartialApply1Of2[Entry, X]#Apply, A](e)

// Seq[A] implements Function1[Int, A]. Without this, Function1FlipMA would be used.
implicit def SeqMA[M[_] <: Seq[_], A](l: M[A]): MA[M, A] = ma[M, A](l)
// Seq[A] implements Function1[Int, A]. Without this, Function1ApplyMA would be used.
implicit def SeqMA[M[X] <: Seq[X], A](l: M[A]): MA[M, A] = ma[M, A](l)

// Set[A] implements Function1[Int, B]. Without this, Function1ApplyMA would be used.
implicit def SetMA[M[X] <: Set[X], A](s: M[A]): MA[M, A] = ma[M, A](s)

implicit def KleisliMA[M[_], A, B](k: Kleisli[M,A,B]): MA[PartialApplyKA[Kleisli, M, A]#Apply, B] = ma[PartialApplyKA[Kleisli, M, A]#Apply, B](k)

Expand Down
2 changes: 2 additions & 0 deletions example/src/main/scala/scalaz/example/ExampleFold.scala
Expand Up @@ -36,6 +36,8 @@ object ExampleFold {
// which lazily handles the infinite Stream.
(Stream.continually(1) ∃ (_ > 0)) assert_≟ true

Set(1, 2, 3) ∃ { _ % 2 == 0 } assert_≟ true

// Checking if all elements satisfy a predicate, using Stream FoldRight,
// which lazily handles the infinite Stream.
(Stream.continually(1) ∀ (_ == 0)) assert_≟ false
Expand Down

0 comments on commit 26455f0

Please sign in to comment.