shapeless: Generic programming for Scala | This room deprecated in favour of #shapeless on the Typelevel Discord: https://discord.gg/bSQBZA3Ced
joroKr21 on main
Update sbt to 1.8.2 (#1296) (compare)
joroKr21 on main
Fixed typo (#1295) (compare)
joroKr21 on main
Update slf4j-nop to 2.0.6 (#129… (compare)
joroKr21 on main
Update slf4j-nop to 2.0.5 (#129… (compare)
joroKr21 on main
Update sbt-scalajs, scalajs-com… (compare)
joroKr21 on main
Update junit-plugin, junit-runt… (compare)
implicit ev: IsHCons[I]
to ensure that I
is not empty.
def foo[H <: Hlist, I <: HList](xs: H, ys: I)(implicit ev: SelectAll[H,I], ev2: IsHCons[I]): Unit = {
println(xs.select[ev2.H])
}
ev2.H
is in H
.
SelectAll
does not guarantee order, so SelectAll[H, I]
does not provide proof that IsHCons[I]
is equal to IsHCons[H]
.
ev2.head(xs)
because while they have the same types, it’s not given that the head of H
is the same type as head of I
. It could be a type not existing in I
, or one of the types in the tail of I
. And if you wanna do xs.select
, you need to provide a Selector
instance for it.
A -> B
and A -> C
then by definition it's not a mapping
A ->
map to, at the type level?
B
or C
?
A -> B
and A -> C
, how is that a mapping?
Boolean
and the value "b" to the type Int
If I have a recursively-resolved typeclass like this:
trait Foo[A] {
type Repr
def to: Repr
}
With at most one instance for a given A
. Is there a way to write an instance summoner that looks something like this:
def instance[A](implicit foo: Foo.Aux[A,R]): R = ???
? And if so, will the compiler correctly infer the concrete type rather than some Foo.Aux…
type?
Foo[A].repr
for a given A
?
implicit def yo: Foo.Aux[A, Int]
implicit def yo: Foo[A]
won't work (that's what I meant by declaring things right)