You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
278 B
Haskell
9 lines
278 B
Haskell
4 years ago
|
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
|