Skip to content

Instantly share code, notes, and snippets.

@machisuji
Created January 11, 2012 13:03
Show Gist options
  • Select an option

  • Save machisuji/1594563 to your computer and use it in GitHub Desktop.

Select an option

Save machisuji/1594563 to your computer and use it in GitHub Desktop.
A SequenceReader should enable reading sequences of elements who are readable themselves.
implicit def seqReader[Seq[T], T](implicit reader: TwpReadable[T]): TwpReadable[Seq[T]] =
new SequenceReader[Seq[T], T] {
def map(in: Input) = reader read in
def canMap(in: Input) = reader.isDefinedAt(in)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment