Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Another attempt to define mockingbird
  • Loading branch information
Georgii Leontiev committed Apr 12, 2012
1 parent 83c3bcd commit aa027fb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/scala/Birds.scala
Expand Up @@ -315,10 +315,10 @@ object Birds {

/**
* M combinator - mockingbird.
* Is this even correct?
* expressing through ski-form: SII
*/
type Mockingbird[F[_]] = {
type Apply = F[this.type]
type Mockingbird = {
type Apply[A] = Starling[Map]#Apply[Idiot#Apply]#Apply[Idiot#Apply[A]]
}

/**
Expand Down
13 changes: 13 additions & 0 deletions src/main/scala/SKI.scala
@@ -0,0 +1,13 @@
package info.folone.birds

/**
* @see: http://apocalisp.wordpress.com/2011/01/13/simple-ski-combinator-calculus-in-scalas-type-system/
*/
object SKI {
trait λ { type ap[_<:λ]<:λ }
type I = λ{type ap[X<:λ] = X }
type K = λ{type ap[X<:λ] = λ{type ap[Y<:λ] = X }}
type S = λ{type ap[X<:λ] = λ{type ap[Y<:λ] = λ{type ap[Z<:λ] = X#ap[Z]#ap[Y#ap[Z]] }}}

type U = S#ap[I]#ap[I]
}

0 comments on commit aa027fb

Please sign in to comment.