Class/Object

sclib.z

ListT

Related Docs: object ListT | package z

Permalink

case class ListT[F[_], A](runListT: F[List[A]]) extends Product with Serializable

minimalistic List monad transformer

Example:
  1. scala> import sclib.z._
    scala> import sclib.ops.`try`._
    scala> (for {
         |   a <- ListT(List(1, 2).success)
         |   b <- ListT(List(3, 4).success)
         | } yield a + b).runListT
    res0: scala.util.Try[List[Int]] = Success(List(4, 5, 5, 6))
    scala> (for {
         |   a <- ListT(List(1, 2).success)
         |   b <- ListT("BOOM".failure[List[Int]])
         | } yield a + b).runListT
    res1: scala.util.Try[List[Int]] = Failure(java.lang.Exception: BOOM)
Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ListT
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ListT(runListT: F[List[A]])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def ++(other: ListT[F, A])(implicit F: Monad[F]): ListT[F, A]

    Permalink

    concat

    concat

    Example:
    1. scala> import sclib.z._
      scala> import sclib.ops.`try`._
      scala> ListT(List(1, 2).success) ++ ListT(List(3, 4).success)
      res0: sclib.z.ListT[scala.util.Try,Int] = ListT(Success(List(1, 2, 3, 4)))
  4. def ++(xs: F[List[A]])(implicit F: Monad[F]): ListT[F, A]

    Permalink

    concat

    concat

    Example:
    1. scala> import sclib.z._
      scala> import sclib.ops.`try`._
      scala> ListT(List(1, 2).success) ++ List(3, 4).success
      res0: sclib.z.ListT[scala.util.Try,Int] = ListT(Success(List(1, 2, 3, 4)))
      scala> ListT(List(1, 2).success) ++ "BOOM".failure
      res1: sclib.z.ListT[scala.util.Try,Int] = ListT(Failure(java.lang.Exception: BOOM))
  5. def ::(a: F[A])(implicit F: Monad[F]): ListT[F, A]

    Permalink

    prepend the given element to the list

    prepend the given element to the list

    Example:
    1. scala> import sclib.z._
      scala> import sclib.ops.`try`._
      scala> 1.success :: ListT(List(2, 3).success)
      res0: sclib.z.ListT[scala.util.Try,Int] = ListT(Success(List(1, 2, 3)))
      scala> "BOOM".failure :: ListT(List(2, 3).success)
      res1: sclib.z.ListT[scala.util.Try,Int] = ListT(Failure(java.lang.Exception: BOOM))
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. def flatMap[B](f: (A) ⇒ ListT[F, B])(implicit F: Monad[F]): ListT[F, B]

    Permalink
  12. def flatMapF[B](f: (A) ⇒ F[List[B]])(implicit F: Monad[F]): ListT[F, B]

    Permalink
  13. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  14. def head(implicit F: Functor[F]): F[A]

    Permalink

    head of the list

    head of the list

    Example:
    1. scala> import sclib.z._
      scala> import sclib.ops.`try`._
      scala> ListT(List(1, 2, 3).success).head
      res0: scala.util.Try[Int] = Success(1)
      scala> ListT("BOOM".failure[List[Int]]).head
      res1: scala.util.Try[Int] = Failure(java.lang.Exception: BOOM)
      scala> ListT(List.empty.success).head
      res2: scala.util.Try[Nothing] = Failure(java.util.NoSuchElementException: head of empty list)
  15. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  16. def map[B](f: (A) ⇒ B)(implicit F: Functor[F]): ListT[F, B]

    Permalink
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. val runListT: F[List[A]]

    Permalink
  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  22. def tail(implicit F: Functor[F]): ListT[F, A]

    Permalink

    tail of the list

    tail of the list

    Example:
    1. scala> import sclib.z._
      scala> import sclib.ops.`try`._
      scala> ListT(List(1, 2, 3).success).tail
      res0: sclib.z.ListT[scala.util.Try,Int] = ListT(Success(List(2, 3)))
      scala> ListT("BOOM".failure[List[Int]]).tail
      res1: sclib.z.ListT[scala.util.Try,Int] = ListT(Failure(java.lang.Exception: BOOM))
      scala> ListT(List.empty.success).tail
      res2: sclib.z.ListT[scala.util.Try,Nothing] = ListT(Failure(java.lang.UnsupportedOperationException: tail of empty list))
  23. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped