rossabaker on jsonp-suite
Complicate the Jsonp regex (compare)
Effect
type class?
F[A]
can't be Kleisli[G, E, A]
because you need an E
before you have any hope of getting an A
out, so you can't write Kleisli[G, E, A] => A
which is basically what Effect is.
IO
inside, it's not a big deal
def foo() = {
val req = ...
client.fetch(req)(x => {
if (x.status == OK) { /* do this /* }
else if (x.status == ReuqestTimeout) { /* do that */ }
//...
}).unsafeRunSync()
}
fetch
you can use an extractor like case Ok(resp)
instead of if (x.status == ....)