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
# coding:utf-8 | |
def λ(a): | |
return a | |
def ほげ(a): | |
return a | |
print λ(5) | |
print ほげ(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
<?php | |
function λ($a) { | |
return $a; | |
} | |
function ほげ($a) { | |
return $a; | |
} | |
echo λ(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
def ほげ(n: Int): Int = { | |
n | |
} | |
println(ほげ(3)) | |
type ほげ = Int | |
def α(n: ほげ): ほげ = { | |
n |
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
type Birds = Int | |
type Pole = (Birds, Birds) | |
-- 鳥 | |
landLeft :: Birds -> Pole -> Pole | |
landLeft n (left, right) = (left + n, right) | |
landRight :: Birds -> Pole -> Pole | |
landRight n (left, right) = (left, right + n) | |
-- バランス棒 |
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
-- オレオレバインド(>>=)の実装 | |
applyMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b | |
applyMaybe Nothing f = Nothing | |
applyMaybe (Just x) f = f x | |
main = do | |
print $ Just 3 `applyMaybe` \ x -> Just (x+1) | |
print $ Just "smile" `applyMaybe` \ x -> Just (x ++ " :)") | |
print $ Nothing `applyMaybe` \ x -> Just (x+1) | |
print $ Nothing `applyMaybe` \ x -> Just (x ++ " :)") |
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
class A { | |
class B | |
def f(b: B) = println("Got my B!") | |
} | |
val a1 = new A | |
println(a1) | |
val a2 = new A | |
println(a2) |
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
class A { | |
class B | |
def f(b: B) = println("Got my B!") | |
} | |
val a1 = new A | |
println(a1) | |
val a2 = new A | |
println(a2) |
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
# -*- coding: utf-8 -*- | |
def AheGaoDoublePeace(text) | |
str = text | |
str = str.gsub(/(気持|きも)ちいい/,'ぎも゛ぢい゛い゛ぃ') | |
str = str.gsub(/(大好|だいす)き/,'らいしゅきいぃっ') | |
str = str.gsub(/(ミルク|みるく|牛乳)/,'ちんぽミルク') | |
str = str.gsub(/お(願|ねが)い/,'お願いぃぃぃっっっ゙') | |
str = str.gsub(/ぁ/,'ぁぁ゛ぁ゛') | |
str = str.gsub(/あ/,'ぁあああ あぉ') |
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
function a() { return "hoge"; } | |
function b() { "use strict"; eeee; eeee } | |
(5 <= 6) ? console.log(a()) : console.log(b()); | |
// (5 >= 6) ? console.log(a()) : console.log(b()); // エラー |
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
function a() { return "hoge"; } | |
function b() { eeee; eeee } | |
(5 <= 6) ? console.log(a()) : console.log(b()); | |
// (5 >= 6) ? console.log(a()) : console.log(b()); // エラー |