简体   繁体   中英

choosing a shapeless HList instead of a case class

What are the advantages of using a shapeless HList over a case class in Scala? In what situations would you not want to use a HList?

You may want to read these questions first:

Essentially case classes are tuples underneath, which in turn map to a Java classes . However HList is a List like data structure. So you may have to traverse the list to access a particular member HList . This is more costly than using a case class member or a tuple member.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM