All Projects → alexknvl → leibniz

alexknvl / leibniz

Licence: MIT License
Leibniz equivalence and Liskov substitutability library for Scala.

Programming Languages

scala
5932 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to leibniz

subml
SubML (prototype) language
Stars: ✭ 21 (-40%)
Mutual labels:  subtyping
superstruct
Rust library for versioned data types
Stars: ✭ 27 (-22.86%)
Mutual labels:  subtyping
samplics
Select, weight and analyze complex sample data
Stars: ✭ 24 (-31.43%)
Mutual labels:  variance
HADailySensor
Sensor for Home Assistant that gets reset at midnight
Stars: ✭ 20 (-42.86%)
Mutual labels:  variance
gmap
heterogenous Map over a GADT
Stars: ✭ 40 (+14.29%)
Mutual labels:  gadt
ke
Fast implementation of queue in OCaml
Stars: ✭ 42 (+20%)
Mutual labels:  gadt
Generator.Equals
A source code generator for automatically implementing IEquatable<T> using only attributes.
Stars: ✭ 49 (+40%)
Mutual labels:  equality
tensority
Strongly typed multidimensional array library for OCaml
Stars: ✭ 44 (+25.71%)
Mutual labels:  gadt
dart sealed
Dart and Flutter sealed class generator and annotations, with match methods and other utilities. There is also super_enum compatible API.
Stars: ✭ 16 (-54.29%)
Mutual labels:  equality
real-async-trait-rs
A proc macro for real async traits, using nightly-only existential types and generic associated types to work around the need for type erasure
Stars: ✭ 38 (+8.57%)
Mutual labels:  existential-types
OOD-Principles-Kotlin
The Principles of OOD in Kotlin 1.3.61
Stars: ✭ 12 (-65.71%)
Mutual labels:  liskov-substitution-principle
cvAUC
Computationally efficient confidence intervals for cross-validated AUC estimates in R
Stars: ✭ 22 (-37.14%)
Mutual labels:  variance
Go Cmp
Package for comparing Go values in tests
Stars: ✭ 2,611 (+7360%)
Mutual labels:  equality
Ood Principles In Swift
💎 The Principles of OOD (SOLID) based on Uncle Bob articles.
Stars: ✭ 1,710 (+4785.71%)
Mutual labels:  liskov-substitution-principle

Leibniz Scala Library

The Leibniz’ equality law states that if a and b are identical then they must have identical properties. Leibniz’ original definition reads as follows:

a ≡ b = ∀ f .f a ⇔ f b

and can be proven to be equivalent to:

a ≡ b = ∀ f .f a → f b

This library provides an encoding of Leibniz' equality and other related concepts in Scala. See my impromptu LC 2018 presentation for an overview.

Witnesses

  • Is[A, B] (with a type alias to A === B) witnesses that types A and B are exactly the same.
  • Similarly, IsK[A, B] (with a type alias to A =~= B) witnesses that types A[_] and B[_] are exactly the same. Combinators exist that allow you to prove that F[A] === F[B] for any F[_[_]] or that A[X] === B[X] for any X.
  • Leibniz[L, H, A, B] witnesses that types A and B are the same and that they both are in between types L and H.
  • Is[F, A, B] witnesses type-equality for F-Bounded types.
  • As[A, B] witnesses that A is a subtype of B.
  • As1[A, B] witnesses that A is a subtype of B using existential types.
  • Liskov[L, H, A, B] is a bounded counterpart to As[A, B].
  • Constant[F] witnesses that HKT F is a constant type lambda.
  • Injective[F] witnesses that HKT F is injective (not a constant type lambda 😃).
  • Covariant[F] witnesses that HKT F is covariant (constant or strictly covariant).
  • Ditto other typeclasses / propositional types in variance package.
  • See my impromptu LC 2018 presentation for an overview.

Quick Start

resolvers += Resolver.bintrayRepo("alexknvl", "maven")
libraryDependencies += "com.alexknvl"  %%  "leibniz" % "0.10.0"

License

Code is provided under the MIT license available at https://opensource.org/licenses/MIT, as well as in the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].