Created
July 20, 2017 16:43
-
-
Save DrBoolean/1d7b1b43966707fb2a050815ddbe523a to your computer and use it in GitHub Desktop.
rep4
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
const Id = x => | |
({ | |
x, | |
map: f => Id(f(x)) | |
}) | |
// to :: Id a -> (() -> a) | |
const to = ({x}) => () => x | |
// from :: (() -> a) -> Id a | |
const from = f => Id(f()) | |
from(to(Id(‘hi’))) // Id(‘hi’) | |
to(from(() => ‘hi’)) // () => ‘hi’ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment