Copyright | Copyright (C) 2021 Yoo Chung |
---|---|
License | GPL-3.0-or-later |
Maintainer | dev@chungyc.org |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Some solutions to Problems.P18 of Ninety-Nine Haskell Problems.
Documentation
slice :: [a] -> Int -> Int -> [a] Source #
Extract a slice from a list.
Given two indices, i
and k
, the slice is the list containing the elements
between the i
'th and k
'th element of the original list, with both limits included.
Start counting the elements with 1.
Go through individual elements in the list, dropping them and then keeping some of the rest.