Browse files

add readme

  • Loading branch information...
1 parent 25b6d76 commit 1872fe4355b202c4142a4bbdb29b67967e5d2a3b Anders Conbere committed Mar 4, 2013
Showing with 22 additions and 0 deletions.
  1. +22 −0 README.mkd
View
22 README.mkd
@@ -0,0 +1,22 @@
+# Trying to make some semigroups
+
+I feel like I've gotten a step closer, but still not quite there.
+
+```scala
+
+import org.conbere.algebra.SemiGroup._
+
+object Algebra {
+ def main(args:Array[String]) = {
+ // this works great
+ val adder = optionSemiGroup[Int]
+ assert(Some(3) == adder(Some(1), Some(2)))
+
+ // this doesn't
+ // scala> Some(1) +| Some(2)
+ // <console>:11: error: could not find implicit value for parameter adder: org.conbere.algebra.SemiGroup[Some[Int]]
+ // Some(1) +| Some(2)
+ Some(1) +| Some(2)
+ }
+}
+```

0 comments on commit 1872fe4

Please sign in to comment.