Permalink
Browse files

Removed scaladocs, added specs2, moved examples to test file (up to c…

…ardinal').
  • Loading branch information...
1 parent 0175020 commit 00245ac5bdfcbbc5f7db0f5603b96a947b136e5f @folone committed Apr 10, 2012
Showing with 68 additions and 4,294 deletions.
  1. +1 −3 .gitignore
  2. +7 −0 build.sbt
  3. +0 −12 src/main/scala/Birds.scala
  4. +60 −0 src/test/scala/BirdsSpec.scala
  5. +0 −20 target/.history
  6. +0 −48 target/scala-2.9.1/api/index.html
  7. +0 −1 target/scala-2.9.1/api/index.js
  8. +0 −16 target/scala-2.9.1/api/index/index-a.html
  9. +0 −31 target/scala-2.9.1/api/index/index-b.html
  10. +0 −25 target/scala-2.9.1/api/index/index-c.html
  11. +0 −22 target/scala-2.9.1/api/index/index-d.html
  12. +0 −19 target/scala-2.9.1/api/index/index-e.html
  13. +0 −25 target/scala-2.9.1/api/index/index-f.html
  14. +0 −16 target/scala-2.9.1/api/index/index-g.html
  15. +0 −16 target/scala-2.9.1/api/index/index-h.html
  16. +0 −28 target/scala-2.9.1/api/index/index-i.html
  17. +0 −22 target/scala-2.9.1/api/index/index-j.html
  18. +0 −19 target/scala-2.9.1/api/index/index-k.html
  19. +0 −16 target/scala-2.9.1/api/index/index-m.html
  20. +0 −16 target/scala-2.9.1/api/index/index-o.html
  21. +0 −22 target/scala-2.9.1/api/index/index-p.html
  22. +0 −28 target/scala-2.9.1/api/index/index-q.html
  23. +0 −22 target/scala-2.9.1/api/index/index-r.html
  24. +0 −19 target/scala-2.9.1/api/index/index-s.html
  25. +0 −16 target/scala-2.9.1/api/index/index-t.html
  26. +0 −22 target/scala-2.9.1/api/index/index-v.html
  27. +0 −25 target/scala-2.9.1/api/index/index-w.html
  28. +0 −1,034 target/scala-2.9.1/api/info/folone/birds/Birds$.html
  29. +0 −77 target/scala-2.9.1/api/info/folone/birds/package.html
  30. +0 −77 target/scala-2.9.1/api/info/folone/package.html
  31. +0 −77 target/scala-2.9.1/api/info/package.html
  32. BIN target/scala-2.9.1/api/lib/arrow-down.png
  33. BIN target/scala-2.9.1/api/lib/arrow-right.png
  34. BIN target/scala-2.9.1/api/lib/class.png
  35. BIN target/scala-2.9.1/api/lib/class_big.png
  36. BIN target/scala-2.9.1/api/lib/class_to_object_big.png
  37. BIN target/scala-2.9.1/api/lib/constructorsbg.gif
  38. BIN target/scala-2.9.1/api/lib/defbg-blue.gif
  39. BIN target/scala-2.9.1/api/lib/defbg-green.gif
  40. BIN target/scala-2.9.1/api/lib/filter_box_left.png
  41. BIN target/scala-2.9.1/api/lib/filter_box_left2.gif
  42. BIN target/scala-2.9.1/api/lib/filter_box_right.png
  43. BIN target/scala-2.9.1/api/lib/filterbg.gif
  44. BIN target/scala-2.9.1/api/lib/filterboxbarbg.gif
  45. BIN target/scala-2.9.1/api/lib/filterboxbarbg.png
  46. BIN target/scala-2.9.1/api/lib/filterboxbg.gif
  47. BIN target/scala-2.9.1/api/lib/fullcommenttopbg.gif
  48. +0 −328 target/scala-2.9.1/api/lib/index.css
  49. +0 −457 target/scala-2.9.1/api/lib/index.js
  50. +0 −401 target/scala-2.9.1/api/lib/jquery-ui.js
  51. +0 −154 target/scala-2.9.1/api/lib/jquery.js
  52. +0 −18 target/scala-2.9.1/api/lib/jquery.layout.js
  53. BIN target/scala-2.9.1/api/lib/navigation-li-a.png
  54. BIN target/scala-2.9.1/api/lib/navigation-li.png
  55. BIN target/scala-2.9.1/api/lib/object.png
  56. BIN target/scala-2.9.1/api/lib/object_big.png
  57. BIN target/scala-2.9.1/api/lib/object_to_class_big.png
  58. BIN target/scala-2.9.1/api/lib/object_to_trait_big.png
  59. BIN target/scala-2.9.1/api/lib/ownderbg2.gif
  60. BIN target/scala-2.9.1/api/lib/ownerbg.gif
  61. BIN target/scala-2.9.1/api/lib/ownerbg2.gif
  62. BIN target/scala-2.9.1/api/lib/package.png
  63. BIN target/scala-2.9.1/api/lib/package_big.png
  64. BIN target/scala-2.9.1/api/lib/packagesbg.gif
  65. +0 −30 target/scala-2.9.1/api/lib/ref-index.css
  66. BIN target/scala-2.9.1/api/lib/remove.png
  67. +0 −71 target/scala-2.9.1/api/lib/scheduler.js
  68. BIN target/scala-2.9.1/api/lib/selected-right.png
  69. BIN target/scala-2.9.1/api/lib/selected.png
  70. BIN target/scala-2.9.1/api/lib/selected2-right.png
  71. BIN target/scala-2.9.1/api/lib/selected2.png
  72. BIN target/scala-2.9.1/api/lib/signaturebg.gif
  73. BIN target/scala-2.9.1/api/lib/signaturebg2.gif
  74. +0 −701 target/scala-2.9.1/api/lib/template.css
  75. +0 −269 target/scala-2.9.1/api/lib/template.js
  76. +0 −14 target/scala-2.9.1/api/lib/tools.tooltip.js
  77. BIN target/scala-2.9.1/api/lib/trait.png
  78. BIN target/scala-2.9.1/api/lib/trait_big.png
  79. BIN target/scala-2.9.1/api/lib/trait_to_object_big.png
  80. BIN target/scala-2.9.1/api/lib/typebg.gif
  81. BIN target/scala-2.9.1/api/lib/unselected.png
  82. BIN target/scala-2.9.1/api/lib/valuemembersbg.gif
  83. +0 −77 target/scala-2.9.1/api/package.html
View
@@ -1,6 +1,4 @@
-target/streams
-target/scala-2.9.1/cache
-target/scala-2.9.1/classes
+target
project
# the following is for vi and emacs users
View
@@ -5,3 +5,10 @@ version := "1.0-SNAPSHOT"
organization := "info.folone"
scalaVersion := "2.9.1"
+
+libraryDependencies ++= Seq(
+ "org.specs2" %% "specs2" % "1.9" % "test"
+)
+
+resolvers ++= Seq("snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
+ "releases" at "http://oss.sonatype.org/content/repositories/releases")
View
@@ -6,35 +6,30 @@ object Birds {
type Idiot = {
type Apply[A] = A
}
- val id: Idiot#Apply[List[Int]] = Nil
// K combinator - kestrel - const. Corresponds to encoding of true in the lambda calculus.
type Kestrel[A] = {
type Apply[B] = A
}
- val kestrel: Kestrel[List[Int]]#Apply[List[String]] = Nil
// B combinator, function composition.
type Bluebird[G[_]] = {
type Apply[F[_]] = {
type Apply[A] = F[G[A]]
}
}
- val bluebird: Bluebird[List]#Apply[List]#Apply[Int] = Nil
// C combinator - cardinal - flip.
type Cardinal[F[_,_]] = {
type Apply[A] = {
type Apply[B] = F[B,A]
}
}
- val cardinal: Cardinal[Map]#Apply[String]#Apply[Int] = Map.empty
// A combinator - apply/applicator, ($)
type Applicator[F[_]] = {
type Apply[A] = F[A]
}
- val applicator: Applicator[List]#Apply[Int] = Nil
// Psi combinator- psi bird, on.
type Psi[G[_,_]] = {
@@ -44,7 +39,6 @@ object Birds {
}
}
}
- val psi: Psi[Map]#Apply[List]#Apply[Int]#Apply[String] = Map.empty
// B3 combinator - becard.
type Becard[F[_]] = {
@@ -54,7 +48,6 @@ object Birds {
}
}
}
- val becard: Becard[List]#Apply[Set]#Apply[List]#Apply[Int] = Nil
// B1 combinator - blackbird
type Blackbird[F[_]] = {
@@ -64,7 +57,6 @@ object Birds {
}
}
}
- val blackbird: Blackbird[List]#Apply[Either]#Apply[Int]#Apply[String] = Nil
// B' combinator - bluebird prime.
type BluebirdPrime[F[_,_]] = {
@@ -74,7 +66,6 @@ object Birds {
}
}
}
- val bluebirdPrime: BluebirdPrime[Map]#Apply[List]#Apply[Int]#Apply[String] = Map.empty
// B2 combinator - bunting.
type Bunting[F[_]] = {
@@ -86,8 +77,6 @@ object Birds {
}
}
}
- import scala.collection.generic._
- val bunting: Bunting[List]#Apply[CanBuildFrom]#Apply[List[String]]#Apply[Int]#Apply[Set[String]] = Nil
// C' combinator - no name.
type CardinalPrime[F[_,_]] = {
@@ -97,7 +86,6 @@ object Birds {
}
}
}
- val cardinalPrime: CardinalPrime[Map]#Apply[List]#Apply[Int]#Apply[String] = Map.empty
// C* combinator - cardinal once removed.
type CardinalStar[F[_,_,_]] = {
@@ -0,0 +1,60 @@
+package info.folone.birds.test
+
+import info.folone.birds.Birds._
+import org.specs2._
+import scala.collection.generic._
+
+class BirdsSpec extends Specification {
+ def is =
+ "This is a specification to check our birds types" ^
+ p^
+ "Idiot should" ^
+ "produce expected type" ! id^
+ p^
+ "Kestrel should" ^
+ "produce expected type" ! k^
+ p^
+ "Bluebird should" ^
+ "produce expected type" ! b^
+ p^
+ "Cardinal should" ^
+ "produce expected type" ! c^
+ p^
+ "Applicator should" ^
+ "produce expected type" ! ap^
+ p^
+ "Psi should" ^
+ "produce expected type" ! ps^
+ p^
+ "Becard should" ^
+ "produce expected type" ! b3^
+ p^
+ "Blackbird should" ^
+ "produce expected type" ! bb^
+ p^
+ "Bunting should" ^
+ "produce expected type" ! b2^
+ p^
+ "Bluebird' should" ^
+ "produce expected type" ! bp^
+ p^
+ "Cardinal' should" ^
+ "produce expected type" ! cp^
+ end
+ def id = (Nil: Idiot#Apply[List[Int]]) mustEqual(List[Int]())
+ def k = (Nil: Kestrel[List[Int]]#Apply[List[String]]) mustEqual(List[Int]())
+ def b = (Nil: Bluebird[List]#Apply[List]#Apply[Int]) mustEqual(List[List[Int]]())
+ def c = (Map.empty: Cardinal[Map]#Apply[String]#Apply[Int]) mustEqual(Map.empty[Int, String])
+ def ap = (Nil: Applicator[List]#Apply[Int]) mustEqual(List[Int]())
+ def ps = (Map.empty: Psi[Map]#Apply[List]#Apply[Int]#Apply[String])
+ .mustEqual(Map.empty[List[Int], List[String]])
+ def b3 = (Nil: Becard[List]#Apply[Set]#Apply[List]#Apply[Int]) mustEqual(List[Set[List[Int]]])
+ def bb = (Nil: Blackbird[List]#Apply[Either]#Apply[Int]#Apply[String])
+ .mustEqual(List[Either[Int, String]]())
+ def b2 = (Nil: Bunting[List]#Apply[CanBuildFrom]#Apply[List[String]]#Apply[Int]#Apply[Set[String]])
+ .mustEqual(List[CanBuildFrom[List[String],Int,Set[String]]]())
+ def bp = (Map.empty: BluebirdPrime[Map]#Apply[List]#Apply[Int]#Apply[String])
+ .mustEqual(Map.empty[Int, List[String]])
+ def cp = (Map.empty: CardinalPrime[Map]#Apply[List]#Apply[Int]#Apply[String])
+ .mustEqual(Map.empty[List[String],Int])
+}
View
@@ -1,20 +0,0 @@
-y
-type-level-birds
-:q
-exit
-help
-np name:type-level-birds org:info.folone version:0.1.0-SNAPSHOT
-name
-name type-level-birds
-exit
-version
-hel[p
-exit
-help
-about
-exit
-install
-test
-exit
-doc
-exit
@@ -1,48 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html>
- <head>
- <title></title>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-
- <link type="text/css" media="screen" rel="stylesheet" href="lib/index.css" />
- <script type="text/javascript" src="lib/jquery.js"></script>
- <script type="text/javascript" src="lib/jquery-ui.js"></script>
- <script type="text/javascript" src="lib/jquery.layout.js"></script>
- <script type="text/javascript" src="lib/index.js"></script>
- <script type="text/javascript" src="lib/scheduler.js"></script>
-
- </head>
- <body>
- <div id="library">
- <img class="class icon" src="lib/class.png" />
- <img class="trait icon" src="lib/trait.png" />
- <img class="object icon" src="lib/object.png" />
- <img class="package icon" src="lib/package.png" />
- </div>
- <div class="ui-layout-west" id="browser">
- <div class="ui-west-center">
- <div id="filter"></div>
- <div class="pack" id="tpl">
-
- <ol class="templates"></ol>
- <ol class="packages"> <li class="pack" title="info">
- <a class="tplshow" target="template" href="info/package.html">info</a>
- <ol class="templates"></ol>
- <ol class="packages"> <li class="pack" title="info.folone">
- <a class="tplshow" target="template" href="info/folone/package.html">info.folone</a>
- <ol class="templates"></ol>
- <ol class="packages"> <li class="pack" title="info.folone.birds">
- <a class="tplshow" target="template" href="info/folone/birds/package.html">info.folone.birds</a>
- <ol class="templates"><li title="info.folone.birds.Birds"><a class="tplshow" target="template" href="info/folone/birds/Birds$.html"><span class="object">(object)</span><div class="placeholder"></div><span class="tplLink">Birds</span></a></li></ol>
- <ol class="packages"> </ol>
- </li></ol>
- </li></ol>
- </li></ol>
- </div></div><script src="index.js"></script>
- </div>
- <div class="ui-layout-center" id="content">
- <iframe name="template" src="package.html"></iframe>
- </div>
- </body>
- </html>

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -1,16 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html>
- <head>
- <title></title>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-
- <link type="text/css" media="screen" rel="stylesheet" href="../lib/ref-index.css" />
- <script type="text/javascript" src="../lib/jquery.js"></script>
-
- </head>
- <body><div class="entry">
- <div class="name">Applicator</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div></body>
- </html>
@@ -1,31 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html>
- <head>
- <title></title>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-
- <link type="text/css" media="screen" rel="stylesheet" href="../lib/ref-index.css" />
- <script type="text/javascript" src="../lib/jquery.js"></script>
-
- </head>
- <body><div class="entry">
- <div class="name">Becard</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">Birds</div>
- <div class="occurrences"><a name="info.folone" class="extype" href="../info/folone/package.html">folone</a> <a name="info.folone.birds" class="extype" href="../info/folone/birds/package.html">birds</a> </div>
- </div><div class="entry">
- <div class="name">Blackbird</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">Bluebird</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">BluebirdPrime</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">Bunting</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div></body>
- </html>
@@ -1,25 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html>
- <head>
- <title></title>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-
- <link type="text/css" media="screen" rel="stylesheet" href="../lib/ref-index.css" />
- <script type="text/javascript" src="../lib/jquery.js"></script>
-
- </head>
- <body><div class="entry">
- <div class="name">Cardinal</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">CardinalPrime</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">CardinalStar</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">CardinalStarStar</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div></body>
- </html>
@@ -1,22 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html>
- <head>
- <title></title>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-
- <link type="text/css" media="screen" rel="stylesheet" href="../lib/ref-index.css" />
- <script type="text/javascript" src="../lib/jquery.js"></script>
-
- </head>
- <body><div class="entry">
- <div class="name">Dickcissel</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">Dove</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">Dovekie</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div></body>
- </html>
@@ -1,19 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html>
- <head>
- <title></title>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-
- <link type="text/css" media="screen" rel="stylesheet" href="../lib/ref-index.css" />
- <script type="text/javascript" src="../lib/jquery.js"></script>
-
- </head>
- <body><div class="entry">
- <div class="name">Eagle</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">Eaglebald</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div></body>
- </html>
@@ -1,25 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html>
- <head>
- <title></title>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
-
- <link type="text/css" media="screen" rel="stylesheet" href="../lib/ref-index.css" />
- <script type="text/javascript" src="../lib/jquery.js"></script>
-
- </head>
- <body><div class="entry">
- <div class="name">Finch</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">FinchStar</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">FinchStarStar</div>
- <div class="occurrences"><a name="info.folone.birds.Birds" class="extype" href="../info/folone/birds/Birds$.html">Birds</a> </div>
- </div><div class="entry">
- <div class="name">folone</div>
- <div class="occurrences"><a name="info" class="extype" href="../info/package.html">info</a> </div>
- </div></body>
- </html>
Oops, something went wrong.

0 comments on commit 00245ac

Please sign in to comment.