myLast :: [a] -> a
Find the last element of a list. Assume the list is non empty.
myButLast :: [a] -> a
Find the last but one element of a list. Assume the list has, at least, two elements.
elementAt :: Int -> [a] -> a
Find the -th element of a list. The first element in the list is number 1. Assume the list has, at least, elements.
myLength :: [a] -> Int
Find the number of elements of a list.
myReverse :: [a] -> [a]
Reverse a list.
isPalindrome :: (Eq a) => [a] -> Bool
Find out whether a list is a palindrome.
myFlatten :: [[a]] -> [a]
Flatten a two-level nested list structure.
compress :: (Eq a) => [a] -> [a]
Eliminate consecutive duplicates of list elements.
pack :: (Eq a) => [a] -> [[a]]
Pack consecutive duplicates of list elements into sublists. If a list contains repeated elements they should be placed in separate sublists.
encode :: (Eq a) => [a] -> [(Int, a)]
Run-length encoding of a list. Consecutive duplicates of elements are encoded as lists ) where is the number of duplicates of the element .
Each item scores 10 points.
Author: Jordi Petit
Generation: 2026-02-03T16:59:20.681Z
© Jutge.org, 2006–2026.
https://jutge.org