Skip to content

Instantly share code, notes, and snippets.

@irof
Created August 3, 2012 03:35
Show Gist options
  • Save irof/3244107 to your computer and use it in GitHub Desktop.
Save irof/3244107 to your computer and use it in GitHub Desktop.
gab_kmさんは関数だったらしい
type Tuna = String
type Tea = String
type Ginger = String
gab_km :: Tuna -> Tea -> Ginger
gab_km "中トロ" "緑茶" = "ガリ"
gab_km "中トロ" _ = "緑茶よこせ"
gab_km _ "緑茶" = "中トロよこせ"
gab_km _ _ = "こんなもん喰えるか!"
$ 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