Exercise 12.1

Seldon
BASIC-Programmierer
BASIC-Programmierer
Beiträge: 119
Registriert: 19. Apr 2012 18:12

Exercise 12.1

Beitrag von Seldon »

There is a Haskell function that does exactly what distinct is supposed to do. I guess renaming it to distinct doesn't count as implementing it, right...?

Also, neither the Haskell function nor my implementation is capable of processing an infinite list of equal elements (like ones = 1:ones). Is that okay for the exercise?

Edit: Nevermind. There can't be a function that takes 20 unique elements out of an endless list of ones, as it has to find the first non-one. However, would the total functional programming language introduced in an earlier exercise recognize this?

Zurück zu „Archiv“