Created
July 22, 2012 16:19
-
-
Save nomeaning777/3160176 to your computer and use it in GitHub Desktop.
プログラミングHaskell 2.6 練習問題
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
-- 3 エラー修正 | |
n = a `div` length xs | |
where | |
a = 10 | |
xs = [1,2,3,4,5] | |
-- 4. 空でないリストの最後の要素 | |
mylast1 list = list!!((length list) - 1) | |
mylast2 list = head (reverse list) | |
-- 5. 空でないリストから最後の要素を取り除く | |
myinit1 list = reverse (tail (reverse list)) | |
myinit2 list = take ((length list) - 1) list | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment