alpha
Login
or
Join now
shuuji3.xyz
/
normal-haskell-programming-book
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/shuuji3/normal-haskell-programming-book. Codes for『ふつうのHaskellプログラミング』http://www.loveruby.net/ja/stdhaskell/
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
create echo.hs and swapa.hs
author
TAKAHASHI Shuuji
date
9 years ago
(Aug 23, 2017, 8:01 AM +0900)
commit
f4f81cfd
f4f81cfd6ce5fd7f598dde4597e2ba091b430c8d
parent
6ad0111e
6ad0111e627b12d769072d33f5cb718855d70bd5
+13
2 changed files
Expand all
Collapse all
Unified
Split
echo.hs
swapa.hs
+5
echo.hs
View file
Reviewed
···
1
1
+
import System.Environment
2
2
+
3
3
+
main :: IO ()
4
4
+
main = do args <- getArgs
5
5
+
putStrLn $ unwords
+8
swapa.hs
View file
Reviewed
···
1
1
+
main :: IO ()
2
2
+
main = do cs <- getContents
3
3
+
putStr $ concatMap translate cs
4
4
+
5
5
+
translate :: Char -> String
6
6
+
translate 'a' = ['A']
7
7
+
translate 'A' = ['a']
8
8
+
translate c = [c]