2012-04-08から1日間の記事一覧
myDrop n xs = if n <= 0 || null xs then xs else myDrop (n - 1) (tail xs) をmyDrop.hsとして保存して、ghci上でロードする。 Prelude> :load myDrop.hs [1 of 1] Compiling Main ( myDrop.hs, interpreted ) Ok, modules loaded: Main. *Main> myDrop 7 …
myDrop n xs = if n <= 0 || null xs then xs else myDrop (n - 1) (tail xs) をmyDrop.hsとして保存して、ghci上でロードする。 Prelude> :load myDrop.hs [1 of 1] Compiling Main ( myDrop.hs, interpreted ) Ok, modules loaded: Main. *Main> myDrop 7 …