milessabin/shapeless — pull request #22 by pufuwozu (2013-02-21 18:17:22+00:00)
Title: Add map method to NatTRel

Signature:

trait NatTRel[L1 <: HList, F1[_], L2 <: HList, F2[_]] {
def map(nt: F1 ~> F2, fa: L1): L2
}

Allows mapping over HLists which have a consistent type constructor
structure with a natural transformation. For example, we can map from:

Option[Int] :: Option[Boolean] :: Option[String] :: Option[Nothing] :: HNil

To:

List[Int] :: List[Boolean] :: List[String] :: List[Nothing] :: HNil

Also delete problematic cases from NatTRel where Const occured on left
hand side. Doesn't seem to make sense when calculating the right hand
side's type.

Code reviewed by @milessabin