I like how the videos lead up gradually to the foldr instruction, making it more intuitive. : )
@mayrosepasasadaba1115
4 жыл бұрын
I love this gash keep making videos xoxo
@red-baitingswine8816
4 жыл бұрын
@ 3:27; Imo "foldr" works first t o the right (to get the nested series of applications of f), executes "f v xn" (= yn), then executes the nested series of applications of f, R to L, inside out.
@sayanghosh6996
Жыл бұрын
no shit sherlock, thats literally whats being told in the lecture with even pictorial help for you. Stating the obvious
@mayrosepasasadaba1115
4 жыл бұрын
Thank you so much!!!!!!!
@clemensw.2587
5 жыл бұрын
thanks, that video definitely helped
@justinthomas3593
2 жыл бұрын
I need help with this totalDigits :: [Integer] -> Integer Example: totalDigits [1, 4, 3, 8, 5, 12, 7] = 1 + 4 + 3 + 8 + 5 + 1 + 2 + 7 = 31 I want a fuction to find the sum of each individual eement in a list. Like how the 12 split into 1 and 2 while adding th rest of elements together
@Opeyonly
5 жыл бұрын
Output of the below code gives zero. I used input [1, 2, 3], what could be wrong. Any help is appreciated multlist :: [Int] -> Int multlist [ ] = 0 multlist (x:xs) = x * (multlist xs)
@gnaurai6251
4 жыл бұрын
I don't want to be mean but i don't see the point when everything described in the video can be replaced by a dead simple forloop example of a C-like equivalent of the showcased multlist: int multlist(int arg[]){ int x = 1; for(int i; i < arg.length; ++i) { x *= array[i]; } return x; } Sure it uses more than one line, but no need to be Einstein's recursive brother to understand it!
@rickiest_rick7704
4 жыл бұрын
Haskell is a functional programming language! You must use a recursion!
@gnaurai6251
4 жыл бұрын
Yes, but in non-functional languages recursion is optional, some problems may be easier to solve by iterating in a loop than with recursion.
@baibhavjoshi1237
4 жыл бұрын
Then why even learn Functional programming?
@rickiest_rick7704
4 жыл бұрын
Or read this: stackoverflow.com/questions/36504/why-functional-languages
@red-baitingswine8816
4 жыл бұрын
To someone who doesn't already know C etc., I imagine your comment isn't completely clear. I don't see any reason not to teach Haskell to novice programmers. It appears to teach some basic computer science, as well as eliminate a lot of distracting, time-and-energy-consuming clerical work. : )
Пікірлер: 16