So many languages, so little time to learn. Right now my learning queue goes like Rust -> Clojure -> Haskell -> programming endgame?. Would've probably started Haskell by now if it were more popular and man do I wish Haskell were more popular.
Clojure is great. I'm a year into it and I love its simplicity. it takes a bit more thought to create an "elegant" solution to problems if you're from an imperative/OOP background, but once that kind of thinking becomes second-nature, the code really does read very well
The Haskell: a -> a -> a add x y = x + y In plain JS terms that would be like: function add(x) { return (y) => x + y; } And calling it would be like: const x = add(1)(2) In this case 'a' refers to the type for the values, so x, y, z should all be the same type for it to be equivalent to "a -> a -> a" meaning const x = add("Hello ")("Currying") Would also fit that function type
Got a notification from this channel and I was like "who is this girl?, Why I'm subscribe to her?, Why does she have a better voice than I?" Until I realized the channel theme 😛...
come back to this video next year, im sure it'll make a whole lot more sense then. i have a whole playlist of videos that i return to every single year and it's testament to my learning that i always find something new in them.
I'm not fluent in English, so I use Google Translate. Thanks for the interesting video. I'm just starting to re-learn category theory using Haskell and Javascript. I wrote a simple program about function composition, associativity, identity morphism, and unit rate. Javascript f = x => { return (x + 2) } g = x => { return (x * 2) } h = x => { return (x ** 2) } i = x => { return h( g(x)) } j = x => { return g( f(x)) } id = x => { return x } c1 = x => { return h(g(f(x))) } c4 = x => { return i ( f(x) ) } c5 = x => { return h(j (x) ) } c1 (3) => c4 (3) => c5 (3) => 100 c1(id(3)) => c4(id(3)) => c5(id(3)) => 100 id(c1(3)) => id(c4(3)) => id(c6(3)) => 100 Haskell f = \x -> x + 2 g = \x -> x * 2 h = \x -> x ^ 2 i = h . g j = g . f c1 = h . g . f c2 = (h . g) . f c3 = h . (g . f) c4 = i . f c5 = h . j c1 3 => c2 3 => c3 3 => c4 3 => c5 3 => 100 Since Haskell provides id (identity function) as standard, we omit the explanation. The result is similar to Javascript. It was so timely and I was so happy that I commented.
Got a "Haskell is useless" recommended video on the side lol
If it's the one I think it is, that guy's actually a functional programming stan, iirc
So many languages, so little time to learn. Right now my learning queue goes like Rust -> Clojure -> Haskell -> programming endgame?. Would've probably started Haskell by now if it were more popular and man do I wish Haskell were more popular.
How is it going?
Clojure is great. I'm a year into it and I love its simplicity. it takes a bit more thought to create an "elegant" solution to problems if you're from an imperative/OOP background, but once that kind of thinking becomes second-nature, the code really does read very well
It's pretty popular, but go learn PureScript instead which works on node and the browser
This is really cool! Please continue doing videos like this!
Great intro to Haskell for Javascript devs
javascript will never be fixed, that's the beauty of it.
sounds like ur in a toxic relationship my dude
@@biskitpagla if javascipt was to be fixed, it would've been ages ago, and we don't have to rely on transpilers, 100s of frameworks
@@hashtag9990its impossible to change js cuz you cant make any breaking changes
can you explain the a -> a -> a I still don't understand
related to partial application (a 2 param fun is in fact a 1 param fun returning a function)
The Haskell:
a -> a -> a
add x y = x + y
In plain JS terms that would be like:
function add(x) {
return (y) => x + y;
}
And calling it would be like:
const x = add(1)(2)
In this case 'a' refers to the type for the values, so x, y, z should all be the same type for it to be equivalent to "a -> a -> a" meaning
const x = add("Hello ")("Currying")
Would also fit that function type
Lol the lodash description for curry is absolutely horrendous
Got a notification from this channel and I was like "who is this girl?, Why I'm subscribe to her?, Why does she have a better voice than I?" Until I realized the channel theme 😛...
I hope nobody considers "true + 1 = 2" to be a "feature". That language broken, yo.
i watched the first 2 minutes of this and i don't really understand it at all. maybe it's because i only know python and scratch.
come back to this video next year, im sure it'll make a whole lot more sense then. i have a whole playlist of videos that i return to every single year and it's testament to my learning that i always find something new in them.
I'm not fluent in English, so I use Google Translate.
Thanks for the interesting video. I'm just starting to re-learn category theory using Haskell and Javascript. I wrote a simple program about function composition, associativity, identity morphism, and unit rate.
Javascript
f = x => { return (x + 2) }
g = x => { return (x * 2) }
h = x => { return (x ** 2) }
i = x => { return h( g(x)) }
j = x => { return g( f(x)) }
id = x => { return x }
c1 = x => { return h(g(f(x))) }
c4 = x => { return i ( f(x) ) }
c5 = x => { return h(j (x) ) }
c1 (3) => c4 (3) => c5 (3) => 100
c1(id(3)) => c4(id(3)) => c5(id(3)) => 100
id(c1(3)) => id(c4(3)) => id(c6(3)) => 100
Haskell
f = \x -> x + 2
g = \x -> x * 2
h = \x -> x ^ 2
i = h . g
j = g . f
c1 = h . g . f
c2 = (h . g) . f
c3 = h . (g . f)
c4 = i . f
c5 = h . j
c1 3 => c2 3 => c3 3 => c4 3 => c5 3 => 100
Since Haskell provides id (identity function) as standard, we omit the explanation. The result is similar to Javascript.
It was so timely and I was so happy that I commented.