久しぶりにhaskellを触ったので、その際に調べたtips的な処理についてメモ リストのslice https://stackoverflow.com/questions/4597820/does-haskell-have-list-slices-i-e-python slice :: Int -> Int -> [a] -> [a] slice from to xs = take (to - from + 1) (drop from xs) リストから最大値を持つindexを取得(argmax) https://stackoverflow.com/questions/14550458/find-max-element-and-index-of-a-list-in-haskell/56056069 import Data.List import Data.Ord maximumBy (c