Which is part of ninety-nine problems in Haskell?
This is part of Ninety-Nine Haskell Problems, based on Ninety-Nine Prolog Problems and Ninety-Nine Lisp Problems . (*) Find the last element of a list.
Why do we have to define a new data type in Haskell?
We have to define a new data type, because lists in Haskell are homogeneous. (**) Eliminate consecutive duplicates of list elements. If a list contains repeated elements they should be replaced with a single copy of the element. The order of the elements should not be changed. (**) Pack consecutive duplicates of list elements into sublists.
How to find a solution to a problem in Haskell?
Then, change n in your block to the appropriate problem number, and fill in the , , and fields. Then be sure to update the status on this page to indicate that we have a solution! These problems have been split into 11 parts, for ease of access.
How to transform a list into a flat list in Haskell?
Transform a list, possibly holding lists as elements into a `flat’ list by replacing each list with its elements (recursively). We have to define a new data type, because lists in Haskell are homogeneous.
How many Prolog problems are there in P-99?
(Though the problems number from 1 to 99, there are some gaps and some additions marked with letters. There are actually only 88 problems.) Known solutions are listed at 99 questions/Solutions. Some of those we have could do with cleaning up or additional solutions. P-99: Ninety-Nine Prolog Problems contains Prolog solutions to all the problems.
Which is the slice of a list in Haskell?
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 (both limits included). Start counting the elements with 1. (**) Rotate a list N places to the left. Hint: Use the predefined functions length and (++). (*) Remove the K’th element from a list.