This file contains hidden or 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
plus1 :: [Int] -> [Int] | |
plus1 [] = [] | |
plus1 (x:xs) = x + 1 : plus1 xs | |
-- plus1 [0,1,2,3] | |
-- > [1,2,3,4] |
This file contains hidden or 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
guess :: Int -> [Char] | |
guess 7 = "Much 7 very wow." | |
guess x = "Ooops, try again." | |
-- strongly inspired by http://learnyouahaskell.com |
This file contains hidden or 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
let x = 5;; | |
x = 6;; | |
print_int x;; (* prints 5 *) |
This file contains hidden or 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
var add = function(a){ | |
return function(b){ | |
return a + b | |
} | |
} | |
var add2 = add(2) | |
add2(3) // => 5 |
This file contains hidden or 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
document.querySelector('#button') | |
.addEventListener('click', function(){ | |
alert('yay, i got clicked') | |
}) |
This file contains hidden or 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
var add = function(a, b){ | |
return a + b | |
} |
NewerOlder