subtyping over shapeless types

26 views
Skip to first unread message

lalg...@gmail.com

unread,
Aug 30, 2015, 10:11:38 AM8/30/15
to Shapeless Dev
This is best illustrated by example.

If I have:
val x = "foo" :: 1 :: true :: HNil

Then I should be able to pass this to any function where a prefix of the above type is expected. For example:

def f(x: String::HNil) = x(0)

However, this is obviously a type mismatch. Is there any way to accomplish this? Ditto: HMap(s), records, etc.

Miles Sabin

unread,
Aug 30, 2015, 10:15:14 AM8/30/15
to shapel...@googlegroups.com
Hi!

This mailing list is more or less deprecated these days. For quick
answers to shapeless-related questions I recommend hopping on
shapeless's gitter channel here,

https://gitter.im/milessabin/shapeless

Cheers,


Miles
> --
> You received this message because you are subscribed to the Google Groups
> "Shapeless Dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to shapeless-de...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Miles Sabin
tel: +44 7813 944 528
skype: milessabin
gtalk: mi...@milessabin.com
http://milessabin.com/blog
http://twitter.com/milessabin
Reply all
Reply to author
Forward
0 new messages