Skip to content

Instantly share code, notes, and snippets.

@jedws
Created October 22, 2013 06:37
Show Gist options
  • Select an option

  • Save jedws/7096108 to your computer and use it in GitHub Desktop.

Select an option

Save jedws/7096108 to your computer and use it in GitHub Desktop.
something very odd going on with scalaz-stream
Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_37).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import scalaz._, Scalaz._, stream._
import scalaz._
import Scalaz._
import stream._
scala> val chan = io.fileChunkR("build.sbt").mapOut { s => new String(s) }
chan: scalaz.stream.Process.Channel[scalaz.concurrent.Task,Int,String] = Await(scalaz.concurrent.Task@8e8cc3b,<function1>,Halt(scalaz.stream.Process$End$),Halt(scalaz.stream.Process$End$))
scala> chan.runFoldMap { _(64).run }
res0: scalaz.concurrent.Task[String] = scalaz.concurrent.Task@37d46c68
scala> :type res0.run
String
scala> res0.run
scalaz.stream.Process$End$
scala> "wat?"
res2: String = wat?
scala> res1
<console>:17: error: not found: value res1
res1
^
@jedws
Copy link
Author

jedws commented Oct 22, 2013

so, Process.End is a an object that extends Exception with no stack trace, calling run throws it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment