


Verifiable tasks, exercises and puzzles. Non-passively consumable pieces of knowledge. Creativity-games and analogue physical tasks. Summed up: everything that gives your brain something to do without AI.
-
AI Detox @feddit.org blueberry @feddit.org99 Haskell Problems - Problem 3
Problem 3
(*) Find the K'th element of a list. Solutions
The first element in the list is number 1. Example:
undefined
* (element-at '(a b c d e) 3) c
Example in Haskell:
elementAt [1,2,3] 2
2
elementAt "haskell" 5
'e'
-
AI Detox @feddit.org blueberry @feddit.org1 crosspost Haskell Wiki - 99 Question - Question 2
Link ActionsProblem 2
(*) Find the last-but-one (or second-last) element of a list. Solutions
(Note that the Lisp transcription of this problem is incorrect.)
Example in Haskell:
myButLast [1,2,3,4]
3
myButLast ['a'..'z']
'y'
-
AI Detox @feddit.org blueberry @feddit.org99 Haskell Problems - Problem 2
Problem 2
(*) Find the last-but-one (or second-last) element of a list.
(Note that the Lisp transcription of this problem is incorrect.)
Example in Haskell:
myButLast [1,2,3,4]
3
myButLast ['a'..'z']
'y'
Source: https://wiki.haskell.org/index.php?title=99_questions%2F1_to_10