contextual

simple and typesafe interpolated strings, checked at compile-time

Package Information

SBT

"com.propensive" %% "contextual-examples" % "1.0.0"

License

Apache 2.0

Source code

Defined contexts

None

Predefined substitution types

None

Binary Arrays of Bytes (bin"")

Features

  • Parses binary data
  • Checks data is an exact number of bytes long
  • Optimized construction of a new array without any heap allocation
  • Does not support substitutions

Examples

> import contextual.examples.binary._
> bin"""01010100010101101010010010101100"""
res: Array[Byte] = Array(84, 86, -92 -84)
> import contextual.examples.binary._
> bin"""10010110"""
res: Array[Byte] = Array(-106)