simianquant / typequux   0.3.0

GitHub

A hackable library for typelevel programming in Scala

Scala versions: 2.13 2.12 2.11
Scala.js versions: 1.x 0.6
Scala Native versions: 0.3

TypeQuux

Build Status Build status Maven Central Scala.js Coverage Status Scaladoc Gitter

Typelevel programming allows developers to encode several flavours of runtime invariants into the type system. Unfortunately, libraries that support typelevel programming tend to be poorly documented, difficult to understand and difficult to hack. This makes them hard to customize to the needs of a specific project/problem.

TypeQuux provides concise, efficient and easy-to-modify implementations of several typelevel programming primitives. As such, it represents collected wisdom on type-hackery in scala.

To see what is possible, head on over to the project site or peruse through the API. You can see an indexed view of supported primitives and their operations here.

To use, add the following line to your build.sbt file:

libraryDependencies += "com.simianquant" %% "typequux" % "0.9.0" // scala-jvm
libraryDependencies += "com.simianquant" %%% "typequux" % "0.9.0" // scala-js/cross

Binaries for 2.11 and 2.12 are available upto version 0.8.1. After version 0.9.0, only 2.13 binaries are available.

Currently supported primitives are:

  1. Church encodings of booleans
  2. Peano numbers
  3. Dense numbers (like peano numbers but much faster)
  4. Type-Sets
  5. Type-Maps
  6. Natural Transformations
  7. Type Unions and Exclusions
  8. Singleton types for literals
  9. Covariant heterogenous lists
  10. HList style operations on tuples
  11. Collections with statically known sizes
  12. Collections indexed by a string, which are like associative maps with static guarantees
  13. Records, which are like adhoc classes
  14. Constraints, that allow you to abstract over arity and structure

Changelog

0.8.0

  1. Drop support for Scala Native

0.8.1

  1. Add FalseConstraint

0.9.0

  1. Add support for Scala 2.13

License

Copyright 2020 Harshad Deo

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.