Created
February 12, 2018 09:54
-
-
Save sabithpocker/b54852c0b1321189ae9d0ead2a6bf458 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
Implement, as best as you can, the identity function in your favorite language | |
(or the second favorite, if your favorite language happens to be Haskell). | |
``` | |
const identity = x => x; | |
``` | |
Implement the composition function in your favorite language. | |
It takes two functions as arguments and returns a function that is their composition. | |
``` | |
const composition = (f, g) => (x => g(f(x))) | |
``` | |
Write a program that tries to test that your composition function respects identity. | |
``` | |
const f = x => `f(${x})`; | |
composition(f, identity)('x'); //"f(x)" | |
composition(identity, f)('x'); | |
``` | |
Is the world-wide web a category in any sense? Are links morphisms? | |
Yes. | |
Is Facebook a category, with people as objects and friendships as morphisms? | |
Yes, kind of. | |
When is a directed graph a category? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment