Packages

  • package root
    Definition Classes
    root
  • package scales

    Scales Xml provides both a more flexible approach to XML handling and a simplified way of interacting with XML.

    Scales Xml provides both a more flexible approach to XML handling and a simplified way of interacting with XML.

    It fits nicely with the Java APIs you know, TrAX and javax.xml.validation for example, allowing you to run XSLTs and convert to and from Scales XML and other DOMs.

    It also provides a far more XPath like experience than the normal Scala XML, Paths look like XPaths and work like them too (with many of the same functions and axes).

    Definition Classes
    root
  • package utils

    The scales.utils packages provide the basis functionality for scales.xml.

    The scales.utils packages provide the basis functionality for scales.xml.

    The Tree an Path collections that underpin the XML model, as well as the iteratee functionality are located in the relevant sub-packages.

    The package object itself pulls in the main utility functions for tree, path and iteratee handling. Import the scales.utils.ScalesUtils object implicit members to provide the path & and | extension functions, the iteratorEnumerator and the +:+ lazy appender for scalaz.EphemeralStream.

    Definition Classes
    scales
  • package iteratee
    Definition Classes
    utils
  • EphemeralStreamEnum
  • Eval
  • IterateeFunctions
  • IterateeImplicits
  • Iteratees
  • functions
  • monadHelpers

object functions

Collection of iterateees

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. functions
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. implicit final class IterOps[E, F[_], A] extends AnyVal
  2. type ResumableIter[E, F[_], A] = IterateeT[E, F, (A, IterateeT[E, F, _])]
  3. class ResumableIterIterator[E, A] extends Iterator[A]

    Only possible to work on IO as it allows us to exit the monad

  4. type ResumableIterList[E, F[_], A] = IterateeT[E, F, (Iterable[A], IterateeT[E, F, _])]
  5. type ResumableIterListStep[E, F[_], A] = StepT[E, F, (Iterable[A], IterateeT[E, F, _])]
  6. type ResumableStep[E, F[_], A] = StepT[E, F, (A, IterateeT[E, F, _])]

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. def appendTo[F[_]](to: Appendable)(implicit F: Applicative[F]): IterateeT[CharSequence, F, CharSequence]

    Append to an appendable, always returns Done for a line, cont for everything else TODO - should it be a pair including the appendable?

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. def dropWhile[E, F[_]](f: (E) ⇒ Boolean)(implicit F: Monad[F]): IterateeT[E, F, Option[E]]

    drop while iteratee, returning the possibly remaining data

  8. def dropWhileM[E, F[_]](f: (E) ⇒ F[Boolean])(implicit F: Monad[F]): IterateeT[E, F, Option[E]]

    Same as dropWhile but captures the Monad in F

  9. def enumToMany[E, F[_], A, R](dest: ResumableIter[A, F, R])(toMany: ResumableIter[E, F, EphemeralStream[A]])(implicit F: Monad[F]): ResumableIter[E, F, R]

    Takes Input[E] converts via toMany to an EphemeralStream[A].

    Takes Input[E] converts via toMany to an EphemeralStream[A]. This in turn is fed to the destination iteratee. The inputs can be 1 -> Many, Many -> 1, or indeed 1 -> 1.

    The callers must take care of what kind of continnuation Iteratee is returned in a Done.

    If the dest returns EOF, the toMany is in turn called with EOF for any needed resource control processing.

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def evalWith[FROM, F[_], TO](f: (FROM) ⇒ TO)(implicit F: Applicative[F]): IterateeT[FROM, F, TO]

    Calls the function param with the fed data and returns its result - consider Scalaz 7 map directly rather than composing

  13. def extract[E, F[_], A](iter: ResumableIter[E, F, A])(implicit F: Monad[F]): F[Option[A]]

    Extract the Some(value) from a Done or None if it was not Done.

  14. def extractCont[E, F[_], A](iter: ResumableIter[E, F, A])(implicit F: Monad[F]): ResumableIter[E, F, A]

    Extract the continuation from a Done

  15. def extractContFromDoneOrCont[E, F[_], A](iter: ResumableIter[E, F, A])(implicit F: Monad[F]): ResumableIter[E, F, A]

    Extract the continuation from a Done, or the continuation itself

  16. def extractContS[E, F[_], A](s: ResumableStep[E, F, A])(implicit F: Monad[F]): ResumableIter[E, F, A]

    Extract the continuation from a Done

  17. def extractS[E, F[_], A](iter: ResumableStep[E, F, A])(implicit F: Monad[F]): Option[A]

    Extract the Some(value) from a Done or None if it was not Done.

  18. def filter[E, F[_]](f: (E) ⇒ Boolean)(implicit F: Monad[F]): IterateeT[E, F, Iterable[E]]

    filter iteratee, greedily taking all content until eof

  19. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def find[E, F[_]](f: (E) ⇒ Boolean)(implicit F: Monad[F]): IterateeT[E, F, Option[E]]

    "find" iteratee, finds Some(first) or None

  21. def flatMap[E, F[_], A, B](itr: IterateeT[E, F, A])(f: (A) ⇒ IterateeT[E, F, B])(implicit F: Monad[F]): IterateeT[E, F, B]

    Based on Scalaz 7 flatMap but exposes the monad through the f parameter

  22. def foldI[E, F[_], A](f: (E, A) ⇒ A)(init: A, stopOn: (A) ⇒ Boolean = (_: A) => true)(implicit F: Monad[F]): ResumableIter[E, F, A]

    Stepwise fold, each element is evaluated but each one is returned as a result+resumable iter.

  23. def foldIM[E, F[_], A](f: (E, A) ⇒ F[A])(init: A, stopOn: (A) ⇒ Boolean = (_: A) => true)(implicit F: Monad[F]): ResumableIter[E, F, A]

    Stepwise fold but the result of f is bound to F

  24. def foldOnDone[E, F[_], A, ACC](e: ⇒ EnumeratorT[E, F])(initAcc: ACC, initResumable: ResumableIter[E, F, A])(f: (ACC, A) ⇒ ACC)(implicit F: Monad[F]): F[ACC]

    Folds over the Iteratee with Cont or Done and Empty, returning with Done and EOF.

    Folds over the Iteratee with Cont or Done and Empty, returning with Done and EOF. If there is a ping pong on enumerator -> Cont -> enumerator then we'll of course get an infinite loop.

    foldI returns a ResumableIter that performs a fold until a done, this folds over the enumerator to return a value.

    combine with onDone to get through chunks of data.

  25. def foldOnDoneIter[E, F[_], A, ACC](initAcc: ACC, initIter: ResumableIter[E, F, A])(f: (ACC, A) ⇒ ACC)(implicit F: Monad[F]): IterateeT[E, F, ACC]

    Enumeratee that folds over the Iteratee with Cont or Done and Empty, returning with Done and EOF.

    Enumeratee that folds over the Iteratee with Cont or Done and Empty, returning with Done and EOF.

    Converts ResumableIters on Done via a fold, returning Done only when receiving EOF from the initIter.

    NB - This can be thought of the reverse of toResumableIter but also accumulating.

  26. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. def isDone[E, F[_], A](iter: IterateeT[E, F, A])(implicit F: Monad[F]): F[Boolean]

    Helper to identify dones

  29. def isDoneS[E, F[_], A](step: StepT[E, F, A])(implicit F: Monad[F]): Boolean
  30. def isEOF[E, F[_], A](iter: IterateeT[E, F, A])(implicit F: Monad[F]): F[Boolean]

    Helper for done and eof

  31. def isEOFS[E, F[_], A](step: StepT[E, F, A])(implicit F: Monad[F]): Boolean

    Helper for done and eof

  32. def isEmpty[E, F[_], A](iter: IterateeT[E, F, A])(implicit F: Monad[F]): F[Boolean]

    Helper for done and empty

  33. def isEmptyS[E, F[_], A](step: StepT[E, F, A])(implicit F: Monad[F]): Boolean

    Helper for done and empty

  34. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  35. def isResumableEOF[E, F[_], A](iter: ResumableIter[E, F, A])(implicit F: Monad[F]): F[Boolean]

    is this iteratee actually "empty"

  36. def isResumableEOFS[E, F[_], A](s: ResumableStep[E, F, A]): Boolean
  37. def iteratorEnumerator[E, F[_]](iter: Iterator[E])(implicit f: Monad[F]): EnumeratorT[E, F]

    Taken from huynhjl's answer on StackOverflow, just abstracting the type to allow for better implicit inference

    Taken from huynhjl's answer on StackOverflow, just abstracting the type to allow for better implicit inference

    def iteratorEnumerator[E](iter: Iterator[E]) = new EnumeratorT[E, Trampoline] { override def apply[A]: StepT[E, Trampoline, A] => IterateeT[E, Trampoline, A] = { case step if iter.isEmpty => iterateeT[E, Trampoline, A](Free.point(step)) case step @ Done(acc, input) => iterateeT[E, Trampoline, A](Free.point(step)) case step @ Cont(k) => val x : E = iter.next

    k(Element(x)) >>== { s => s.mapContOr(_ => sys.error("diverging iteratee"), apply(s)) } } }

  38. def mapTo[E, F[_], A](f: (E) ⇒ Input[EphemeralStream[A]])(implicit F: Applicative[F]): IterateeT[E, F, EphemeralStream[A]]

    Maps a given input to a function returning a Input[EphemeralStream].

    Maps a given input to a function returning a Input[EphemeralStream]. If the Input is El it returns it, if EOF empty and continues on empty.

  39. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  42. def onDone[E, F[_], A](originalList: List[ResumableIter[E, F, A]])(implicit F: Monad[F]): ResumableIterList[E, F, A]

    onDone, iterates over the list of iteratees applying the element, when the resulting list contains a Done then the list of Dones is returned.

    onDone, iterates over the list of iteratees applying the element, when the resulting list contains a Done then the list of Dones is returned.

    One can use tuples or pattern matching to discern which of the original lists iteratees have matched.

    Due to the return type of this iteratee all items in the list must return the same type and must return both an A and an IterV with the same interface to continue with the next and maintain state.

    In the case of EOF, an empty list is returned

  43. def repeatUntil[E, F[_], A](init: A)(f: (A) ⇒ A)(stopOn: (A) ⇒ Boolean)(implicit F: Monad[F]): F[(A, ResumableIter[A, F, A])]

    Repeating fold on done, calling f with the result to accumulate with side effects, stopping when stopOn is true and returns the accumulated value continuation iteratee pair.

  44. def repeatUntilM[E, F[_], A](init: A)(f: (A) ⇒ F[A])(stopOn: (A) ⇒ Boolean)(implicit F: Monad[F]): F[(A, ResumableIter[A, F, A])]

    Repeating fold on done, calling f with the result to accumulate with side effects, stopping when stopOn is true and returns the accumulated value continuation iteratee pair.

  45. def resumableEOF[E, F[_], A](input: A = null)(implicit F: Applicative[F]): ResumableIter[E, F, A]

    marks a continuation resumableiter as actually being EOF - i.e.

    marks a continuation resumableiter as actually being EOF - i.e. don't attempt to evaluate it

  46. def resumableEOFDone[E, F[_], A](input: A)(implicit F: Applicative[F]): ResumableStep[E, F, A]
  47. def runningCount[E, F[_]](implicit F: Monad[F]): ResumableIter[E, F, Long]

    keeps a running count of each element, probably not of much use unless combined but acts as a good poc for ResumableIter

  48. def sum[T, F[_]](implicit n: Numeric[T], F: Applicative[F]): IterateeT[T, F, T]

    Sums an iteratee up, consider using the Scalaz IterateeT monadic sum instead

  49. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  50. def toResumableIter[E, F[_], A](oiter: IterateeT[E, F, A])(implicit F: Monad[F]): ResumableIter[E, F, A]

    Converts a normal IterV[E,A] to a ResumableIter.

    Converts a normal IterV[E,A] to a ResumableIter.

    Does so by folding over the iter once for an input and when its Done starting again with the original iter. This is close to restarting the iter on a new "stream", otherwise all attempts to keep the Cont will be made.

  51. def toString(): String
    Definition Classes
    AnyRef → Any
  52. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  54. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  55. def withIter[E, A](e: EnumeratorT[E, IO])(initResumable: ResumableIter[E, IO, A]): ResumableIterIterator[E, A]

    Converts the iteratee/enumerator/source triple into a Iterator.

    Converts the iteratee/enumerator/source triple into a Iterator. This is only possible in IO given the ability to exit the monad _and_ trampoline.

    For most uses iterate is a better option

Deprecated Value Members

  1. def enumerateeMap[E, F[_], A, R](target: IterateeT[A, F, R])(f: (E) ⇒ A)(implicit F: Monad[F]): IterateeT[E, F, R]

    Enumeratee that converts input 1:1 String => Int, enumerator Iterator[String] but IterV[Int, Int]

    Enumeratee that converts input 1:1 String => Int, enumerator Iterator[String] but IterV[Int, Int]

    Annotations
    @deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped