Skip to content

Releases: fthomas/singleton-ops

Releasing 0.5.2

21 Oct 16:07
b7f78ef
Compare
Choose a tag to compare

Added

  • Bitwise operations: BitwiseOr and BitwiseAnd

Releasing 0.5.1

31 May 15:33
Compare
Choose a tag to compare

Fixes

  • GetArg now returns lazy values for non-literals to support by name arguments.

Added

Thanks to @erikerlandson, #135 adds several string and regex operations.

  • type SubSequence[S, IBeg, IEnd]
  • type StartsWith[S, Prefix]
  • type EndsWith[S, Suffix]
  • type Head[S]
  • type Tail[S]
  • type Matches[S, Regex]
  • type FirstMatch[S, Regex]
  • type PrefixMatch[S, Regex]
  • type ReplaceFirstMatch[S, Regex, R]
  • type ReplaceAllMatches[S, Regex, R]

Releasing 0.5.0

09 Apr 07:40
c2a8761
Compare
Choose a tag to compare

Towards much better performance and potential Scala 3.0 support

With added caching, use of Scala 2.13.x Singleton and other improvements, we have ~20% performance increase in Scala 2.13. Scala 2.12.x/2.11.x also got a performance bump.
The code is moving towards having a macro-less dependency above the literal-type computation. This is because dotty officially has literal-type arithmetic, so we currently assume that will be in Scala 3.0, and we will rely on it to provide the additional singleton-ops features (like TwoFace and Checked).

New Features

  • Caching (under-the-hood). Since literal type arithmetic is done via implicits, caching the operations and sub operations can improve performance significantly in codebases that use many similar such operations.

Dropped

  • Symbol support. Since Scala 2.13.x now official deprecated symbols (in favor of literal strings), it's time to remove this from the library as well.
  • Global implicit conversions for containers. E.g.
trait Foo[T]
val foo5 : Foo[5] = Foo[2 + 3]
val fooWide : Foo[Int] = Foo[5]

This used to work out-of-the-box, but caused unnecessary checks for the compiler.
Instead we need to add:

trait Foo[T]
object Foo {
  implicit def caster[F, T](c : Foo[F])(implicit eq : OpContainer.Eq[F, T, Int]) : Foo[T] = c.asInstanceOf[Foo[T]]
}

Improvements and Fixes

  • GetArg and GetLHSArg Improvements. These constructs use to refer to specific argument value in order to get the more narrow type from its tree. More cases are handled, and including a workaround for weird string interpolation behavior.