trait MessageParser[A] extends AnyRef
MessageParser is a typeclass to simplify parsing messages. It can derive instances for any ADT, and makes it much easier to work with messages.
- A
The type to parse.
- Self Type
- MessageParser[A]
- Source
- MessageParser.scala
- Alphabetic
- By Inheritance
- MessageParser
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def parse[F[_]](implicit c: CacheSnapshot, F: Monad[F], E: ApplicativeHandle[F, String], S: MonadState[F, List[String]]): F[A]
A program to parse a message into the needed types.
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
- def andThen[B](that: MessageParser[B]): MessageParser[(A, B)]
Runs another parser after this one.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def collectWithError[B](error: String)(pf: PartialFunction[A, B]): MessageParser[B]
Apply a partial function of this parser, returning the error if the function isn't defined.
Apply a partial function of this parser, returning the error if the function isn't defined.
- B
The new parser type.
- error
The error to return if the partial function isn't defined.
- pf
The partial function to apply.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def filterWithError(f: (A) => Boolean, error: String): MessageParser[A]
Create a new parser by filtering the values created by this parser.
Create a new parser by filtering the values created by this parser.
- f
The predicate.
- error
The error message if the value does not match the predicate.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- 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() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def orElse[B](that: MessageParser[B]): MessageParser[Either[A, B]]
Try another parser if this one fails.
- def orElseWith[B, C](that: MessageParser[B])(f: (Either[A, B]) => C): MessageParser[C]
Try another parser if this one fails, and combine their types.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])