On Mon, Jul 2, 2012 at 8:48 PM, Alois Cochard <
alois....@gmail.com> wrote:
> Hi all,
>
> Here is a feature which make possible to transform an HList type to an other
> one, for example it can be used to 'convert' 'List[String] :: List[Int]' to
> 'Option[String] :: Option[Int]':
>
> Implemantation available here:
>
https://github.com/aloiscochard/shapeless/commit/fe6932d3a813bbb9dd149218bbe345e892863a61
>
> By using 'Id' it's too possible to 'extract' type from a type constructor,
> please looks at test for more details.
>
> Don't hesitate to propose a better name!
I'm not so sure about this one. It seems like it's doing two things
simultaneously. First it's a constraint that all the elements of HList
L share the outer type constructor F[_]; and second it's computing the
result type of mapping a natural transformation F ~> G over L.
I'm not convinced that we need both of these combined into a single
type. Can't you just use the UnaryTCConstraint for the first part of,
and a Mapper/MapperAux for the second? Especially seeing as if you
need the type of the mapped result it's probably because you're going
to want to compute the map, so you'll need the Mapper/MapperAux
anyway?
Cheers,
Miles
--
Miles Sabin
tel:
+44 7813 944 528
skype: milessabin
gtalk:
mi...@milessabin.com
g+:
http://www.milessabin.com
http://twitter.com/milessabin