I hereby claim:
- I am bryce-anderson on github.
- I am brycelane (https://keybase.io/brycelane) on keybase.
- I have a public key whose fingerprint is D795 F052 A43C 58AE 3A27 651E 0764 616F 7E54 47BC
To claim this, I am signing this object:
sealed trait HeaderKey { | |
type HeaderT <: Parsed[_] | |
def go(t: HeaderT): Unit = () | |
def name: String | |
} | |
/* |
// a simple process1 that splits the frames up based on a "\r\n" sequence of chars | |
val partitioner = { | |
import java.util.regex.Pattern | |
import scalaz.stream.process1 | |
import scalaz.std.string._ | |
val pattern = Pattern.compile("\r\n") | |
process1.repartition { s: String => | |
pattern.split(s, -1) |
sealed abstract class JValue | |
final class JBoolean private(val value: Boolean) extends JValue | |
object JBoolean { | |
val True = new JBoolean(true) | |
val False = new JBoolean(false) | |
def apply(value: Boolean): JBoolean = if (value) True else False |
I hereby claim:
To claim this, I am signing this object:
public int go2(org.http4s.client.blaze.Foo$Thing); | |
Code: | |
0: aload_1 | |
1: astore_2 | |
2: aload_2 | |
3: instanceof #16 // class org/http4s/client/blaze/Foo$ThingA | |
6: ifeq 48 | |
9: aload_2 | |
10: checkcast #16 // class org/http4s/client/blaze/Foo$ThingA | |
13: astore_3 |
package scalaz.stream | |
import java.io._ | |
import scodec.bits.ByteVector | |
import scalaz._, Scalaz._, stream._ | |
import scalaz.stream.nio._ | |
case req@ Post -> Root / "challenge" => | |
val body = req.body.collect { | |
case c: BodyChunk => new String(c.toArray) | |
}.toTask | |
body.flatMap{ s: String => | |
if (!s.startsWith("go")) { | |
Ok("Booo!!!") | |
} else { | |
Ok(emit(s) ++ repeatEval(body)) |
def weave[O, B, F[_]](p: Process[F, O], p1: Process1[O, B]) | |
(implicit M: Monad[F], C: Catchable[F]): F[(Seq[B], Process[F, O])] = { | |
// Nearly a direct copy of process1.feed, except it returns any unused inputs | |
def feed(i: Seq[O], p: Process1[O,B]): (Seq[O], Process1[O,B]) = { | |
@annotation.tailrec | |
def go(in: Seq[O], out: Vector[Seq[B]], cur: Process1[O,B]): (Seq[O], Process1[O,B]) = | |
if (in.nonEmpty) cur match { | |
case h@Halt(_) => (in, emitSeq(out.flatten, h)) | |
case Emit(h, t) => go(in, out :+ h, t) |