mandubian/shapeless-rules — pull request #1 by stanch (2014-02-17 22:17:00+00:00)
Title: Improve hfold

Here it is :) (I checked the compilation, just didn’t commit the `build.sbt` modified for my system)
One thing I’m working on is lifting arbitrary applicatives in `HList`s:
```scala
case class A(foo: Int, bar: Int, baz: Int)

val r = from[JsValue] { __ ⇒
(__ \ "foo").read[Option[Int]] ::
(__ \ "bar").read[Int] ::
(__ \ "baz").read[Int] ::
HNil
}.fmap(l ⇒ liftA[Option].apply(l)).fmap(_.map(Generic[A].from))
```
This produces `Rule[JsValue, Option[A]]`. Imagine this working with `Future` (or [`Resolvable`](http://scala-needs.github.io/Introduction.html)), for example. In fact, this is the same as https://github.com/scala-needs/play-functional-extras, but for `HList`s instead of tuples. I’ll probably push the results to that repo, once I have something less boilerplatey :)