| Copyright | Copyright (C) 2021 Yoo Chung |
|---|---|
| License | GPL-3.0-or-later |
| Maintainer | dev@chungyc.org |
| Safe Haskell | Safe-Inferred |
| Language | GHC2021 |
Problems.P18
Description
Part of Ninety-Nine Haskell Problems. Some solutions are in Solutions.P18.
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.
Examples
>>>slice "abcdefghijk" 3 7"cdefg"