Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
Add README contents
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiko Seeberger committed Sep 27, 2013
1 parent a725092 commit 5ed2c9e
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,43 @@
# demo-equality #

Welcome to demo-equality!
Demos for type-safe equality with Scala implicits.

The simplest approach gives you a **type-safe** yet **unbalanced** `===` equality operation:

```
scala> import name.heikoseeberger.demoequality._
import name.heikoseeberger.demoequality._
scala> import SimpleEquality._
import SimpleEquality._
scala> 123 === 666
res0: Boolean = false
scala> "a" === "a"
res1: Boolean = true
scala> 123 === "a"
<console>:14: error: type mismatch;
found : String("a")
required: Int
123 === "a"
scala> Seq(1, 2, 3) === List(1, 2, 3)
res3: Boolean = true
scala> List(1, 2, 3) === Seq(1, 2, 3)
<console>:17: error: type mismatch;
found : Seq[Int]
required: List[Int]
List(1, 2, 3) === Seq(1, 2, 3)
```

For type- or view-based balanced equality more information see my blog series "Implicits unchained – type-safe equality":

- [Part 1](http://hseeberger.github.io/blog/2013/05/30/implicits-unchained-type-safe-equality-part1): simple yet unbalanced equality
- [Part 2](http://hseeberger.github.io/blog/2013/05/31/implicits-unchained-type-safe-equality-part2): type-wise balanced equality
- [Part 3](http://hseeberger.github.io/blog/2013/06/01/implicits-unchained-type-safe-equality-part3): view-wise balanced equality

## Contribution policy ##

Expand Down

0 comments on commit 5ed2c9e

Please sign in to comment.