C9 Lectures: Dr. Erik Meijer - Functional Programming Fundamentals Chapter 2 of 13

  Рет қаралды 28,798

jasonofthel33t

jasonofthel33t

Күн бұрын

Пікірлер
@andref82
@andref82 10 жыл бұрын
In order for the layout structure to work better then { } I believe the compiler should enforce the tab/space required. In other case it can lead to "issues".
@l2ubio
@l2ubio 2 жыл бұрын
50:10 anyone knows which tutorial of the Prelude was he referring too?
@Sando816
@Sando816 5 жыл бұрын
Thank you for the amazing lectures.
@fiaskolo
@fiaskolo 6 жыл бұрын
Better t-shirt in this chapter.
@hos7012
@hos7012 4 жыл бұрын
hehehe
@lucagorzog2490
@lucagorzog2490 7 жыл бұрын
I can't find the triangol in my keyboard
@PlerbyMcFlerb
@PlerbyMcFlerb 11 жыл бұрын
I heard LINQPad's a good interactive c# environment
@amitnadkarni3090
@amitnadkarni3090 10 жыл бұрын
for finding last element: lst xs = drop (length xs -1) xs is this right?
@TheTarabyte
@TheTarabyte 10 жыл бұрын
Not really. Library last gives you the last element. Yours - list with one or zero elements. last :: [a] -> a lst :: [a] -> [a]
@tomdahulk
@tomdahulk 10 жыл бұрын
No; Your function drops all elements except the last one from the list. You end up with a singleton list if there is one or more elements in the list, and an empty list if there are 0 elements. A confusing edit to your function could get you the last element though--- lst xs = head $ drop (length xs - 1) xs, but as TheTarabyte said, you're better off just implementing it the way ghc does. last [] = error "no last element in an empty list" last [x] = x last (x:xs) = last xs Pattern matching ftw.
@omrikatz2107
@omrikatz2107 8 жыл бұрын
wouldn't it be easier to reverse the list and get the first elm?
@QuasarRedshift
@QuasarRedshift 11 жыл бұрын
What I especially like about Haskell is the minimum amount of 'hand-waving' that is required to write down some code; the language dispenses with symbolic noise and goes straight for the jugular! On the other side, making code too 'cute' and compressed makes it difficult to read and it starts looking like APL or J. One day I shall go to a coffee bar and ask for a 'quadruple' instead of a 'double double' and see if they figure it out (nerd joke). Do you actually program in Haskell yourself?
@hakanorskaya
@hakanorskaya 6 жыл бұрын
Yeah yeah, i know. Thank you.
@toxicore1190
@toxicore1190 8 жыл бұрын
C# now has one :)
@yankumar5280
@yankumar5280 10 жыл бұрын
thanks for sharing jasonofthel33t
@chris_sndw
@chris_sndw 11 жыл бұрын
Give love to your code! lol
@MrJC1
@MrJC1 6 жыл бұрын
I know that it would kind of break the rules, and perhaps defeat the purpose somewhere a long the line... but couldn't the functions be grouped into some kind of namespace style of thing, but not exactly... like... i don't know.... algorithms.drop 3... but then perhaps 'algorithms.' disappears when you type 'drop' leaving you with just 'drop 3'. that idea? but then you could get a list of all the algorithms in that group if you didn't know them all... i suppose this could help with the intellisense "problem". ah i dunno, maybe it could just be an optional thing for n00bs.
@metallitech
@metallitech 8 жыл бұрын
So haskell leaves out the brackets that are used in maths. Annoying! Why not try to look like the maths that we grew up learning.
@187dv3
@187dv3 7 жыл бұрын
It's just you current sense of what parenthesis are. In haskell evaluation is right to left instead of the usual reading sense. So f(g(x)) = f g x = f (g(x)) Just do the right to left reading and it makes sense again.
@javierfernandez1126
@javierfernandez1126 6 жыл бұрын
The answer to your question is actually much more interesting. It turns out that one of the most important formalizations of computation is the lambda calculus. In it, function application is modeled not by using parenthesis, but by putting the argument to the right of the function that is going to be applied to it. This way of putting things allows to build "computer programs" out of a notation almost equal to conventional mathematics (it is truly amazing how such a notation could make every posible computer program). Probably you are not interested, but i will leave you a video where that is explained in a lot more detail: kzbin.info/www/bejne/aYe0ZGtohqxgr5Y And also a wikipedia article where all the elements of a computer programming language are constructed out of this formalization: en.wikipedia.org/wiki/Church_encoding
@TavartDukod
@TavartDukod 6 жыл бұрын
@@187dv3 no, it's wrong. f g x = (f g) x, as in lambda calculus. If you want f(g(x)), you should write f (g x).
React 2014 : Erik Meijer  - What does it mean to be Reactive?
46:39
React Conference
Рет қаралды 87 М.
Почему Катар богатый? #shorts
0:45
Послезавтра
Рет қаралды 2 МЛН
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН
Erik Meijer: Functional Programming
1:07:58
jasonofthel33t
Рет қаралды 101 М.
Simon Peyton Jones - Haskell is useless
6:23
bunidanoable
Рет қаралды 372 М.
Rich Hickey - The Database as a Value
56:23
jasonofthel33t
Рет қаралды 9 М.
The Rust Survival Guide
12:34
Let's Get Rusty
Рет қаралды 179 М.
Почему Катар богатый? #shorts
0:45
Послезавтра
Рет қаралды 2 МЛН