Last active
December 21, 2015 12:59
-
-
Save 314maro/6309905 to your computer and use it in GitHub Desktop.
よくよく考えればこれだけでよかったんだ 無駄なことした気がするぜ
ただ、sumを置き換えれるように引数取るようにするとエラー なんでだろ
と思ってたら、再帰の部分をfoo xsと書いてたからだった あるある
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
import Data.List (transpose,tails) | |
hoge = foo sum | |
fib = hoge [0,1] | |
lucas = hoge [2,1] | |
tri = hoge [0,0,1] | |
tetra = hoge [0,0,0,1] | |
foo f xs = xs ++ map f a | |
where a = transpose $ take (length xs) $ tails $ foo f xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment