Perform operations on lists
parent
baf0c2c0db
commit
0009cebb33
@ -0,0 +1,9 @@
|
|||||||
|
myRepeat :: a -> [a]
|
||||||
|
myRepeat n = cycle [n]
|
||||||
|
|
||||||
|
subseq :: Int -> Int -> [a] -> [a]
|
||||||
|
subseq first last aList = take last (drop first aList)
|
||||||
|
|
||||||
|
inFirstHalf :: Eq a => a -> [a] -> Bool
|
||||||
|
inFirstHalf item aList = item `elem` firstHalf
|
||||||
|
where firstHalf = take (length aList `div` 2) aList
|
Loading…
Reference in New Issue