Comment detail

文字変換表に基く文字列の変換 (Nested Flatten)

愚直な実装です

1
2
3
4
5
6
import System.Environment
replace s (f,t) = map (\x->if x == f then t else x) s
tr s fro = last . scanl replace s . zip fro
main = do 
  fro:to:s:xs <- getArgs
  putStrLn $ tr s fro to

Index

Feed

Other

Link

Pathtraq

loading...