Last active
November 13, 2017 10:28
-
-
Save mandubian/3f37c6525ed539f2fba0545325061228 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def plus = (x:Int) => (y:Int) => x + y | |
// First, we need to reify our CCC language | |
val K = implicitly[CartesianClosedCat[Function1]] | |
// First, we need to reify our CCC numeric extensions for Int (ok it's a bit hard coded but that's not the point here ;)) | |
val E = implicitly[CCCNumExt[Function1, Int]] | |
// now we import CCC language into our context | |
import K._, E._ | |
// the line on top is strictly equivalent to the following in CCC language | |
def plus = addC ○ (exl[Int, Int] ⨂ exr[Int, Int]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment