Safe Haskell | Safe |
---|
Solutions to Exercises for November 16, 2018
Exercise 2
Exercise 3
ptriples :: (Enum c, Eq c, Num c) => c -> [(c, c, c)] Source #
The function ptriples
computes all so called Pythagorean triples with
components up to a certain size.
Exercise 4
prefixes :: [a] -> [[a]] Source #
The function prefixes
computes all prefixes of a given list (including the
list itself) in increasing order of length.
suffixes :: [a] -> [[a]] Source #
The function suffixes
computes all suffixes of a given list (including the
list itself) in decreasing order of length.
Exercise 5
sublists :: [a] -> [[a]] Source #
The function sublists
computes all sublists of a given list in increasing
order of length. Here, a sublist is obtained from a list by omitting
arbitrarily many of its arguments.
Exercise 6
smartStack :: [Picture] -> Picture Source #