Created
August 3, 2012 03:35
-
-
Save irof/3244107 to your computer and use it in GitHub Desktop.
gab_kmさんは関数だったらしい
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
type Tuna = String | |
type Tea = String | |
type Ginger = String | |
gab_km :: Tuna -> Tea -> Ginger | |
gab_km "中トロ" "緑茶" = "ガリ" | |
gab_km "中トロ" _ = "緑茶よこせ" | |
gab_km _ "緑茶" = "中トロよこせ" | |
gab_km _ _ = "こんなもん喰えるか!" |
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
$ ghci | |
GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help | |
Loading package ghc-prim ... linking ... done. | |
Loading package integer-gmp ... linking ... done. | |
Loading package base ... linking ... done. | |
Prelude> :load gab_km.hs | |
[1 of 1] Compiling Main ( gab_km.hs, interpreted ) | |
Ok, modules loaded: Main. | |
*Main> | |
*Main> putStrLn $ gab_km "中トロ" "緑茶" | |
ガリ | |
*Main> putStrLn $ gab_km "カッパ巻き" "緑茶" | |
中トロよこせ | |
*Main> putStrLn $ gab_km "ピザ" "コーラ" | |
こんなもん喰えるか! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment