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
- Alphabetic
- By Inheritance
- TakeOne
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
-
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
-
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 thattake1Opt
allows caller to handle emptiness within Source contextThis is useful when you want to tranform empty Source into something else
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def drop1[Element](src: Source[Element])(implicit monad: Monad[Source]): Source[Element]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def isFollowedBy[Element](src: Source[Element])(expected: List[Element])(implicit EQ: Eq[Element], monad: Monad[Source], Cons: Cons[Source]): Source[(Boolean, Source[Element])]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )