Skip to content

Feature overview: shapeless 2.1.0

Miles Sabin edited this page Jan 22, 2015 · 3 revisions

Contents

All the examples below assume you have previously imported shapeless._

See also the feature overview for shapeless 2.0.0.

Operations on HLists/records/Coproducts/unions/Tuples/products

shapeless provides a broad range of operations on HListss, Coproducts, shapeless records and unions, standard Scala tuples and other Scala types which are subtypes of the Scala Product type. As of shapeless 2.1.0 the range of operations available for Coproducts has been significantly expanded and made more consistent with those available for HLists. The observation that it is possible to find a Coproduct operation corresponding to every HList operation underpins work that will be done in shapeless 3.0.0.

HList record Coproduct union tuple product
::
+:
:+
++, :::
++:
+
-
align
apply
at
collect
deembed
drop
embed
extendLeft
extendLeftBy
extendRight
extendRightBy
fieldAt
filter
filterNot
flatMap
fold
foldLeft
foldMap
foldRight
get/apply
head
init
keys
last
length
map
mapCons
mapConst
mapValues
merge
mkString
partition
patch
permutations
productElements
record
reduceLeft
reduceRight
remove
removeAll
removeElem
renameField
replace
replaceType
reverse
reverse_:::
reverse_split
reverse_splitLeft
reverse_splitRight
rotateLeft
rotateRight
runtimeLength
scanLeft
scanRight
select
split
splitLeft
splitRight
tail
take
to
toArray
toHList
toList
toMap
toRecord
toSized
toTuple
transpose
tupled
unify
unifySubtypes
union
unzip
updateWith
updated
updatedAt
updatedElem
updatedType
values
zip
zipApply
zipConst
zipOne
zipWith
zipWithKeys