Packages

trait TakeOne[Source[_]] extends AnyRef

Typeclass to provide capability of taking 1 element from a data source

User needs to implement 2 methods

  • take1
  • take1Opt
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TakeOne
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def take1[Element](src: Source[Element]): Source[(Element, Source[Element])]

    takes an element from Source and return the Element with the rest of the Data without escaping the Source context

    takes an element from Source and return the Element with the rest of the Data without escaping the Source context

    It will return empty source if input source is empty, the emptiness is implied and not captured in part of the type

    essentially List[Int]() and List[String]() are equivalent

  2. abstract def take1Opt[Element](src: Source[Element]): Source[(Option[Element], Source[Element])]

    takes an element from Source and return the element with the rest of the Data

    takes an element from Source and return the element with the rest of the Data

    It will return None and Empty source if input source is empty, the main difference of this method versus take1 is that take1Opt allows caller to handle emptiness within Source context

    This is useful when you want to tranform empty Source into something else

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. def drop1[Element](src: Source[Element])(implicit monad: Monad[Source]): Source[Element]
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def isFollowedBy[Element](src: Source[Element])(expected: List[Element])(implicit EQ: Eq[Element], monad: Monad[Source], Cons: Cons[Source]): Source[(Boolean, Source[Element])]
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. def peek1[Element](src: Source[Element])(implicit Functor: Functor[Source], cons: Cons[Source]): Source[(Element, Source[Element])]

    returns the 1st element from the source without consuming the data source

  18. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped