msiegenthaler/pusca — Issue #8: Add a way to require trueness of a function
Author: msiegenthaler
Created: 2011-12-04 18:57:42+00:00
State: open

i.e. the following code requires f to be a pure function but currently there is no way to declare or enforce that:

```scala
def mapping[A, B](f: A ⇒ B): Iteratee[A, B] = {
def handle(in: Input[A]): Iteratee[A, B] = in match {
case Data(d) ⇒ cont(handle, f(d))
case Empty ⇒ cont(handle)
case EOF ⇒ done
}
cont(handle)
}
```