Saturday, 15 February 2014

Unclear scala compiler behaviour when using shapeless to map over tuples -



Unclear scala compiler behaviour when using shapeless to map over tuples -

assume next setup:

val f = new (int -> int)(_ + 1) object g extends (int -> int)(_ + 1)

then have

(1,2) map g (2,3)

but

(1,2) map f

fails compile error

error: not find implicit value parameter mapper: shapeless.ops.tuple.mapper[(int, int),f.type] (1,2) map f

but (f == g) in terms of ->[a,b], missing?

scala shapeless

No comments:

Post a Comment