i think this video might be giving a slightly different definition of Functors than is generally excepted across all FP communities. It does a terrific job of expressing the utility of map and giving some intuition of the interface though and I'm stoked to see stuff like this gaining popularity! Functor is simply an interface with 1 function: map. This is the definition that holds for scala, f#, clojure, Haskell, etc, as well as category theory. It should be the same for js too, in my opinion. Monads build off of this definition as well. String cannot be Functor because it does not allow the function given to map to transform values into different types. Something called parametricity. Filter is not a Functor in that way either. Array map is though for sure. I'm happy that people are interested in functional programming and I don't mean to be a stickler or anything - I just wouldn't want people getting a conflicting idea and blurring the current ubiquitous definition.
@funfunfunction9 жыл бұрын
+Brian Lonsdorf I've tried to get clarity in this before the episode, but it was extremely hard to get a clear-cut answer, so I ran out of time and just targeted trying to get the viewer to "get" functors rather than getting the details right, as seems open to interpretation to me, or at least there is a lot of confusion in the community. :) Perhaps you can help me clear some things up: 1. Your statement "String cannot be a functor" lies in conflict with "Array map is [a functor] though for sure" for me. Is a functor a function OR an object implementing a map function? 2. I need some clarification on why filter would not be a functor. filter returns an array, and it passes the individual parts of the array into it's callback. Where would you say that the transformation happens? That it returns an array of a different size? 3. Would you say that Promises are monads or not? I've heard voices on both sides. If there is room for interpretation, I would like us to opt for the interpretation that Promises are monads, because it would make it a lot easier to educate the JavaScript community on Monads, given that we're familiar with the Promise as a concept.
@shaydenmartin48489 жыл бұрын
+mpjme The formal definition within the context of Haskell can be found here: wiki.haskell.org/Functor. The concept should be the same for JS, but given that JS is very far from a purely functional language, a formal definition probably doesn't exist nor would it be all that useful. The important concept when dealing with functors is the notion of context. A functor is a data structure that wraps another value in some context. In addition, a mapping function must exist, which takes a callback that alters the wrapped value and returns it in the same context. An array is a functor in the sense that it wraps it's members values, and provides the context of set membership, an order, and what ever other properties apply to arrays in JS, and because it provides a map function. 1. Strings aren't functors in JS as far as I know, but a string is just a list of characters, or values in a context. So if you were to create a mapping function that treated them as such, like the "stringFunctor" function in your video, strings would become a functor. Arrays already have a mapping function and are functors "out of the box". 2. A functor is a data structure. Neither map or filter is a functor, but map acts on functors as per their definition. Filter is not relevant to the technical definition of a functor. Though you might consider it to be relevant to a more informal concept of a functor, in that it acts on a data structure that wraps some value and it returns a value in that same context. Filter could be considered the mapping function in this circumstance. I believe this is correct, but I'm not an FP expert, so anyone reading please feel free to correct me. 3. I don't really have the credentials to say whether or not Promises are technically monads, but I know that some important people in JS land also favor that analogy (Crockford namely). It makes sense to me, I would say that they are in spirit at the very least.
@brianlonsdorf49069 жыл бұрын
+mpjme Yeah man, there's a surprising lack of real world examples and tons of implementation walkthroughs and overly mathy "show off" explanations out there. You're video is really helpful to gain an intuition and totally touches on what it means to be a functor. As a contributor to FantasyLand (github.com/fantasyland/fantasy-land) I figured I'd chime in with a few adjustments to help support the spec. Let me answer these questions here... 1.I misspoke about Array's map there. A Functor is definitely is an object (or type) that has a (reasonable) map method. Array itself is a functor since it has map that works correctly (though it technically shouldn't be passing along index if it wants to be formally correct) 2. Apart from not being an object or the map method itself, the "different size" is one big reason. It should always preserve structure exactly, just apply a transform to each element. So that's the second reason - filter doesn't actually transform elements, it just keeps them around. 3. I totally agree! They are definitely monadic in general, but the specific A+ spec breaks that by "auto-flattening" since monad's main ability is to flatten down 1 level. To explain, consider jQuery's map: $('.link').map(() => $(this).children()) // [el, el, el, el] But we would have expected: // [[el, el], [el, el], []] But jQuery was "helpful" and flattened the array for us, making it impossible to get an array of children's children. There's a ticket marked "no-fix" bugs.jquery.com/ticket/10541 Incidentally, jQuery's object is not a Functor either because its map does not preserve the structure. For all intents and purposes though, we can consider it so and use it as such (but it breaks the Functor laws and our expectations) Anyways, Promise in A+ has the same problem: Promise("I should be two promises deep").then(x => Promise(x)) // Promise("I should be two promises deep") making the main function of the Monad interface useless. Practically speaking, it breaks generic, reusable functions written to work with any Functor or Monad. If we rename Promise's "then" to "map", we can consider it a Functor (and ignore the nesting thing in A+). Doing so would allow us to swap out Promise for EventStream or Array or a Tree or whatever since we're programming to an interface rather than a custom method.
@rafekennedy13299 жыл бұрын
+mpjme Let me try and give a quick answer to your first 2 questions. 1. The reason string 'cannot' be a functor is because it is not possible to assign anything other than a single character string to the i-th index of the string. So, for example, if I wanted to 'map'; over my string to replace the characters with their charcodes, as at this video, I will not end up with a string 'containing' numbers, but rather one 'containing' numbers coerced to strings. What's more, they will be, in general, multi-character strings. These facts will break one of the functor laws (which I'll write below). 2. I don't think you could implement an alternative array functor (let's call it ';array2') with filter as the 'map' function, because again it would break a functor law. So the two functor laws are that: (using js method-like notation) (i) deepEqual(functor.map(id), functor) (where id just returns its argument) (ii) deepEqual(functor.map(f).map(g), functor.map(compose(g, f))) Let's see what why a string cannot be a functor. Let's have f = (char) => char.charCodeAt(0) and g = (char) => char + 1 So let';s see the output with a string, let functor = 'a'. functor.map(f).map(g) === "971" functor.map(compose(g, f)) === "98" As you can see, law (ii) is violated. It seems to me that filter would also violate this, because when you compose g and f, you would return the boolean into g, whereas if you 'map'ped them sequentially, g would receive the value of the element itself.
@shaydenmartin48489 жыл бұрын
After a quick Google, I'm not so sure that there is a consistent definition of Functors across the FP community. I think this is confused by the fact that in category theory, functors are functions. But given the concept of a functor in FP, I believe it makes much more sense to use functor to refer to the data structure and not it's mapping function, because the data structure must implement the Functor interface, the function is part of that implementation. This is the case in Haskell.
@rebelroadside9 жыл бұрын
Nothing is more valuable than learning all the JS functors inside and out. 99% of the time I've gotten stuck, it's because I wasn't properly using a functor or didn't even knew a particular functor existed. Great video, mpjme.
@DanielMinshewTheInternet9 жыл бұрын
Glad to see functional investigations returning. I think it's important to be able to translate ideas from one field into another, and explaining any shortcomings of the "in this case" definition is by no means a failure on your part. Teachers will often have to summarize ideas and use analogy, with the goal of inciting thought within the mind of the student, which is exactly what your lessons do. In general, I would like to see even more depth in the linear examples, these moments tend to give me the most insight! Thank you
@ThePhantazmya9 жыл бұрын
I don't know anything about JS and I have a limited knowledge of programming but I understood everything in your video. Plus it was awesome to hear you say "functor" over and over again.
@Bigdaddy919828 жыл бұрын
To split a string into an array of characters, you can simply use the spread operator. Like this - const functorString = (string, fn) => { return [...string].map((x) => String.fromCharCode(addone(x.charCodeAt(0)))).join('') } const addone = (num) => num + 1; console.log(functorString('ABC', addone))
@RillJit9 жыл бұрын
Loving the js stuff, I think it's very relevant to a lot of people. Anything giving structure to weird programming problems or situations that people face is really interesting :)
@sudhakarreddy98798 жыл бұрын
I follow your functional programming series. I feel my knowledge is growing from episode to episode, just like your hair.. ;)
@Nerdcoresteve19 жыл бұрын
I really did get something from this! :-) It made a lot of sense. I would love to learn more about category theory, monads, Haskell, and all that good functional stuff. Don't shy away from the math either. :-)
@loliveira9 жыл бұрын
+Nerdcoresteve1 +1
@MarufSiddiqui9 жыл бұрын
+Nerdcoresteve1 +1
@luigileung9 жыл бұрын
+Nerdcoresteve1 +1
@vladimirfilimon6718 жыл бұрын
+Nerdcoresteve1 +1
@mario1ua8 жыл бұрын
+Nerdcoresteve1 +1
@ociemitchell9 жыл бұрын
I enjoy the practical advice in your videos about being a better programmer. I think I prefer that to the really abstract math underlying the programming concept.
@rickbehl1009 жыл бұрын
Very nice video which gives a great first step into an area I am not familiar with. Thumbs up!
@yyny09 жыл бұрын
This is the first time I saw someone actively refer to a KZbin suggestion (rather than a annotation). Well done, you got me! :D
@bhatpravinyt8 жыл бұрын
Very well presented, abstract concept was presented in a very understandable & interesting way.
@SimonBeee9 жыл бұрын
Spot on, I really get a lot from these functional programming episodes. I personally would love for you to go further into detail on this series as watching them has been setting off lots of lightbulbs that other methods of learning haven't managed too yet. So for that, thank you. More please :)
@MartinoNotts9 жыл бұрын
Complex idea, succinctly explained. Thanks. Your videos help me a lot..
@JohnMichaelReed9 жыл бұрын
Hey mpjme! I am from OOP (Java/Scala) and I have no concept of category theory or of lambda calculus. All I heard is that if you take a quadrant with object types on the X axis and function types on the Y axis and you draw dividing lines that are vertical, you get OOP and if you draw dividing lines that are horizontal, you get FP. In Scala there is this notion of creating generics with parameters that are explicitly covariant or explicitly contravariant and sort of making hierarchies of generics and then passing things into these hierarchies of generics. I never learned any category theory or lambda calculus, but these concepts (covariant, contravariant) make sense to me. Also, the concept of separating functions without side effects (no parenthesis) and functions with side effects (parenthesis) kind of makes sense because you want reusable stuff to not have side effects. If I were you, I would start from there.
@varunmunjeti30429 жыл бұрын
I would personally love it if you do dive in to the finer details. You do a great job of simplifying harder concepts in a way that's very easy to follow and understand =D
@purovenezolano146 жыл бұрын
Awesome. Watching this as prep-work for the Monad video :)
@nicolasschurmann9 жыл бұрын
Hey!, good video, i agree with +Burabure and +Brian Lonsdorf, IMHO functors also are containers where you can supply a function to apply it to the contained value. function M(val) {this.val = val} and the interface to apply a function to this value M.map = M.prototype.map = function(f) {return new M(f(this.val))} Following this i may say IMHO that map is not a functor, but a container that implements a method to apply a function to it's value and returns a new instance of this same should be called a functor. You can call this however you like but an accepted way following the fantasy-land specification is map. Also a string is not a container but a data type. Reduce do a little more than just applying a function to the contained values. you may try this: a = [1, 2, 3] a.filter(x => x) // [1, 2, 3] b = [true, false, true] b.filter(x => x) // [true, true] BTW great videos!, i would love to see monads :), specially an example of Reader.T and it's use case.
@Neppord9 жыл бұрын
I really liked this video. I like explanations that tells me: this is good enough even tough its not "correct". It does not confuse you since you are "warned" but it still makes you curious and feel more secure when looking into the subject. I would like to see more Haskell side by side of JavaScript, example by example.
@ryantomczik49169 жыл бұрын
One thing from the video/blog that was unclear to me is if Reduce in JavaScript is a Functor or not. From the blog it says, "The returned structure can be any type as long as you can get to the individual elements." It doesn't say if the Functor needs to enforce this rule. In the case of JavaScripts and Clojure having dynamic typing, it depends on the the function you pass Reduce if the output is a collection that you can get at the individual elements. In Scala on the other hand, being Statically typed, Reduce requires that the return type to be of type T (e.g. for Array[Int] type T is Int). So I assume the general Functional Programming answer is Reduce is not a Functor. In the case for Dynamic programing languages it depends on how you use it. Anyways, great video man! My vote for the next videos is to go into another functional programming language in depth. I vote for either Clojure, Elm or Haskell in that order!
@lvidakovic9 жыл бұрын
+1 for functional programming concepts/approaches that you found useful in javascript
@MarkusBurrer3 жыл бұрын
Finally I understand what a functor is, thanks.
@burabure71879 жыл бұрын
Awesome video!, would love to see more like this. One detail, while in practice stringFunctor works mostly like mapping a functor should, there's an important part missing: a functor is a container object that haves a method to apply functions to the contained values (map) or can be passed to a function that applies a function to it (fmap). stringFunctor is complecting the container with the mapping, so it's less flexible and doesn't compose nicely.
@funfunfunction9 жыл бұрын
+Burabure Hey Burabure! Glad you liked it. Could you give some example code on how the string mapping example (the one I implement as stingFunctor) could be implemented in line with your correction? I'm not sure I understand from the abstract explanation.
@adamtak31289 жыл бұрын
+mpjme hey could you please tell me which code editor and what the theme you're using in your functional programming series?
@burabure71879 жыл бұрын
+mpjme Made an example on jsbin =) jsbin.com/rejizu/edit?js,console
@alexandersobolev52848 жыл бұрын
I think what you are describing isn't a functor. Functor is sort of a Container object which has map (for chaining) and flatMap (to unfold the final value when chaining is finished) methods on it. const Container = x => ({ map: f => Containter( f ( x ) ), flatMap: f => f( x ) }); Moreover, I believe it also has to follow some math laws. The one that I could think of right now is the associativity law, when Container( x ).map( function1 ).map( function2 ) is the same as Container( x ).map( x => function2( function1( x ) ) ) P.S. Anyways, I love your videos. Great stuff!
@HEDKiller869 жыл бұрын
A Haskel series woud be awesome!......I dont know Haskel but ive read that a good reason to learn Haskel is that it's language features are being adopted in new languages because of its maintainbility and safeness.
@kevinwhitakertx9 жыл бұрын
Great video! I'd love to see one on monads!
@adfafdadfjdlskjfl19 жыл бұрын
Category theory, monads and haskell all the way! :)
@BeatSmithTV7 жыл бұрын
Helped me reason about a feature I'm building into an app! Thanks MPJ!
@AmirHashemii7 жыл бұрын
Thanks for your great shows!
@david596759 жыл бұрын
Where's the plant?
@funfunfunction9 жыл бұрын
+David Andersson lol
@oleksandrmaliarenko8245 жыл бұрын
You're the best JS youtuber :) I really do enjoy your videos. Thanks for your work!
@nazmulhasanmasum80955 жыл бұрын
This video made better sense to me about functor.
@feldinho9 жыл бұрын
Now I can see the true power of currying! Great video! :D
@ShreyasPBabu5 жыл бұрын
Always wondered what functors were and now I know I had been using it for a while.
@78njh339 жыл бұрын
Just wanted to say your videos explain things so much more clearly than the majority of coding-related content out there. Not sure why that is, maybe it's that you introduce only a few concepts at the time and don't make the examples any more complicated than is needed. Thanks for producing these - I look forward to your follow-up video.
@Mitchicus949 жыл бұрын
Haskell series I think would be awesome!
@thuathanik8 жыл бұрын
+1 on Haskell series
@luigileung9 жыл бұрын
+1 for a bit of category theory, monads, and Haskell (with analogies in JavaScript if possible). Great videos! Your style is very entertaining. Thanks!
@kaellunas9 жыл бұрын
I would love to go as deep as possible into functional programming. I find it fascinating, and I have no qualms about you going over the math involved if necessary.
@BogdanNenu9 жыл бұрын
Hi, first let me say that the video was great, it succeeded to clarify for me something which although I read about in several other books/articles I did not get until now - generically how a functor works and what is good for. I followed the comments and might seem that the explanation is not completely correct or complete somehow but I think even if that is true it is still valuable because it brings us closer to fully comprehend the topic. I am not a programming master nor a math wizz and the functional stuff looks very alien to me but I still want to learn and understand and I need these examples and funny presentations to go through :) digesting all this things. I am here for functional programming in javascript, but if what it takes to learn that is going into category theory, high level math concepts and haskell I will gladly do it as long is explained also for simple minds like myself and presented in a fun and light way.
@exquisiteoath9 жыл бұрын
Monads please. I'm even willing to accept the difference between monads as an abstract ideal and a Javascript pattern, as you've done with functors. For most programming purposes we just need to understand how and why a pattern helps create better code, not the underlying math behind it. I think you've done a fantastic job of this with Functors.
@JulianSloman8 жыл бұрын
Very much appreciated the simple function
@samjiman9 жыл бұрын
Some nice examples. :) Good video as usual.
@weareworkingonit5 жыл бұрын
Arrays them selfs are a functor. Functors are types that obey certain rules/laws and that implement map.
@CarlosEstebanLopezJaramillo9 жыл бұрын
Very useful, hey would like a video on modules and inheritance, that's a very important matter in today development.
@yyny09 жыл бұрын
+Carlos Esteban “Luchillo17” Lopez Jaramillo Yes! I am currently struggling on how to implement private variables (closures, underscore, Symbols, getters, etc. (Not to forget generalisation, ugh...)) and I think there's a whole range of other problems you can talk about within the module topic.
@mickvangelderen37459 жыл бұрын
+Carlos Esteban “Luchillo17” Lopez Jaramillo have you watched +mpjme' Composition over Inheritance video?
@CarlosEstebanLopezJaramillo9 жыл бұрын
+Mick van Gelderen Yes i have, still i would like to see it with the import module from ES6
@BadPotat09 жыл бұрын
+Carlos Esteban Lopez Jaramillo (“Luchillo17”) Dude, use TypeScript with the Atom plugin, it's seriously a no brainer.
@CarlosEstebanLopezJaramillo9 жыл бұрын
+BadPotato It's no like idk how, after all i'm using angular 2 with ES6 imports and extends, i'm suggesting a subject that i would like to see how will he explain it, i like how he explain things, easy and clear.
@TheJessejunior3 жыл бұрын
missing you and your videos.... these days I still come back here to understand somethings...
@cyphos848 жыл бұрын
My advice would be to keep your videos practical. Show us new functional concepts that we can apply to our everyday coding projects that either make our code more elegant and readable, reduce the likelihood of bugs, or make our code more extensible. I think just mentioning the Math-related context to the concept is good enough, and then perhaps do your "finger point to the right" to show a related video if the viewer is interested in learning more about the related mathematical concept. So far, I've been focused on learning functional programming, and therefore only watched your videos related to functional programming. Although I'm sure I'll watch the other videos before too long, I eagerly await for the next FP video. :)
@jackninja19 жыл бұрын
please more of this practical javascript!
@Samuel_kam8 жыл бұрын
Excellent video thank you very much
@sirajussalekin92398 жыл бұрын
Awesome explanation.
@excessioneleven31055 жыл бұрын
Hey, thanks for all the stuff, and, about other courses, i think maths are very interesting especially when done by js in canvas
@GuillermoValleCosmos8 жыл бұрын
I also would be interested in functional stuff, and don't mind the maths (i actually like it..), and you teach stuff really well
@NotAColorLilac9 жыл бұрын
My favorite video of yours!
@Heliofurz6 жыл бұрын
5:15 can't you use sth. Like "String.prototype.map = function [...]" in order top create a 'Map'-Version for strings in general?
@Mateush539 жыл бұрын
You want feedback? Ok. That was awesome. Its one of the best videos you created :) If possible, please keep making more videos on functional javascript. Or even better - please recommend some sources.
@funfunfunction9 жыл бұрын
+Mateush53 Thanks a ton, Mateush! Means a lot this feedback, I'm totally unable to tell what videos are good myself. The videos I really like before release often bomb and the ones I feel suck (this one was one of them) gets really well received. :P More functional and more reading sources coming up.
@yyny09 жыл бұрын
Suggestion: Use Array#filter when you are talking about Array.prototype.filter, and use Array.filter when you are actually talking about the function filter on the object Array.
@falconmick7 жыл бұрын
Would stringFunctor be a good usecase for currying? Like curry the function call so you can define a stringIncrementFunctor and just pas the value in later? Or is that just overdoing it
@tomldev9 жыл бұрын
Loved it. Definitely would not mind diving into category theory and other mathematical concepts in a video. If time is an issue, keep it short, kind of introductory and then you could send us to resources (blogs, books or code) for more in depth, self driven learning. I'm sure if you based it on someone else's interpretation too and just credit them - the video format generally just makes it so much easier to grock.
@ronyazereza9 жыл бұрын
Great vid, really would like to see more Functional Programming videos. Question : when do you use functional programming instead of oop? Thanks
@rossgeography6 жыл бұрын
BTW is there a Functional Programming Video 9 [NINE??]
@NipunaGunathillake9 жыл бұрын
Awesome set of videos! Really enjoying and learning a lot from your videos. About proceeding with the series, I don't think it would be good to go into the maths of things. Also, could you please give us some additional sources that you would recommend for learning Javascript Functional programming?
@Kernel.Cosplay9 жыл бұрын
Awesome video yet again. I would love it if you would get more into monads if basic category theory is needed for that, so be it. The idea of making videos on Haskell is a wonderful idea. I started noticing that a lot of Javascript developers started picking up Haskell to become better at Javascript maybe other developers can benefit from the same.
@fuunnx9 жыл бұрын
Nice to see some functionnal programming again ! Really great in complement of the "mostly adequate guide" I started to read : drboolean.gitbooks.io/mostly-adequate-guide/content/ Thank you for making awesome videos !
@Offa49 жыл бұрын
+Géraud Henrion +mpjme I have just finished this book, it explained category theory within javascript with a very practical point of view, which I believe is the best way to approach these concepts without delving into mathematical hell. I totally support what you are doing and I hope you can continue on with functional programming, simplifying monads, applicatives and more with your simple attractive explanations. I am currently researching this field, specially that it can make web development much much more fun using purely-functional javascript. There is already so many libraries out there in JS that would aid this approach. ramdajs.com, github.com/fantasyland/fantasy-land, github.com/folktale are good examples.
@HannanAlisyntacticspi9 жыл бұрын
Bro! I really like your room... It seems nice and cozy. :)
@BadPotat09 жыл бұрын
Please go ahead with monads :) After all, there's many redundant concepts like "what is a lambda" then after many exercices/practices we simply learn it's an "anonymous function". It's true that learning haskell may help, but... people here want monads in JS!
@rossgeography6 жыл бұрын
Brilliant we are back on track - gotta say video 8 on Promises is WAY too advanced to be included for newbies
@rossgeography6 жыл бұрын
ES6 version easier (at least for me) let stringFunctor = function(value, fn){ var chars = value.split("") return chars.map((char) => String .fromCharCode(fn(char.charCodeAt(0)))) .join("") }
@birkhansonkan42369 жыл бұрын
Omg i thought you made up all those words but it turns out that they are real JavaScript terminologies. :) :)
@madjestic7 жыл бұрын
I think a video or two on Category Theory could be terrific?
@LeonGaban8 жыл бұрын
Awesome video, loved it!
@slim_mike4 жыл бұрын
I'm not sure I got it, any function that maps over an array with a given function and return the result of the mapping, is a functor?
@shineLouisShine2 жыл бұрын
Thanks. Not sure why does the output of the second string is "RXY" though.. Did you mean "WXY"..?
@jerneje9 жыл бұрын
awesome, more of this, indeed.
@Sjoakra9 жыл бұрын
How about more in the lines of writing good and efficient code. Like how to do DOM manipulation the right way. Or a good way divide code in to modules that works together/without each other?
@badi10728 жыл бұрын
Where is part 9 of the functional programming series?
@alejandrogiussi63697 жыл бұрын
I would definitely like a series on Haskell!
@cschandragiri7 жыл бұрын
Thanks well explained!
@stevencoffman39879 жыл бұрын
I am interested in more functional programming concepts, as well as your throughts on Crockford classless vs es6 classes.
@funfunfunction9 жыл бұрын
+Steven Coffman Thanks! You might want to check out my factory functions + composition over inheritance videos. They more or less summarise my position. tl;dr I'm on the Crockford train. I was really happy to see his classless thing, because that is the way I had been doing it for the last year too.
@oeb259 жыл бұрын
I'd like to see some haskell videos :)
@yyny09 жыл бұрын
+oeb25 Maybe he can hide some haskell code in a corner?
@zoundozer9 жыл бұрын
SLAM DUNK THE FUNCTOR, MAP IT UP, GOT DAT FEELIN' GRRRRL~~~🎶🎷😎
@АндрейМунтян-ь3д9 жыл бұрын
Tnx! great video! I'm waiting for new one about monads
@mario1ua8 жыл бұрын
We should start learning category theory!
@BladeAurora9 жыл бұрын
awesome video! would love to see videos about monads! :)
@avielbt9 жыл бұрын
QUESTION whats your favorite javascript IDE? are you thinking about going all out Typescript ?
@funfunfunction9 жыл бұрын
+aviel I'm a recovering tooling alcoholic. I don't use IDEs personally, if I can avoid it (I can't for Java, but for all languages that are feasible to write without, I use a text editor. I always try to find the simplest possible tooling to work with when I want to achieve a task, and any complex tooling distracts me and I end up spending more time tweaking my tooling than it could possibly save me. For the same reason, I do almost no customization of my text editor either, no atom plugins etc. I also cannot be trusted with productivity apps of any kind, especially not the customizable kind like remember the milk. This is wisdom: xkcd.com/1205/
@idcmardelplata9 жыл бұрын
Very good explanation , thanks. I hope that part of the functors aplicative . bad spelling is the fault of google translator : P
@axosi9 жыл бұрын
1. Great video, using those everyday so it's nice to know their name and what their definitions is. Feedback: 2. You said something like doing Haskell videos, well... why not make it harder for you and us. Haskell + Javascript in the same video, Haskell code next to Javascript implementation. 3. Leave more resources (links) under your videos if you can. Thank you
@TomAndrewsDeveloper9 жыл бұрын
I would say as long there are practical examples that show why you would use a concept then there will not be a problem. Talking about the concept purely in the abstract is where I would likely start to lose you.
@rvgn7 жыл бұрын
With promises, what is the difference between `.then` and `.map`?
@funfunfunction7 жыл бұрын
You'll get the long answer in the monad (Promises is a type of monad) video, but then is sort of like a map on steroids, that will resolve any promise that the "mapper" returns. You can also watch my talk about monads on nordic js.
@rvgn7 жыл бұрын
I must be missing something. I just created a promise in my browser, and it doesn't have `.map`. ``` const p = Promise.resolve([ 1, 2, 3 ]); p.then(console.log); // => logs the array p.map(console.log); // => error: p.map is not a function ``` Am I holding it wrong? I would expect `p.map(console.log)` to log each item individually.
@okaybenji9 жыл бұрын
Great video! If you want to keep dragging your feet on functional programming topics, I would love to see a video on React! :]
@jamesmeyers99089 жыл бұрын
I would love to see a series about Haskell.
@WayneKSeymourIIIProgrammer6 жыл бұрын
Why not flip the args for stringFunctor?
9 жыл бұрын
Nice episode as always, but this is the 10th episode not the 9th.
@levisaidmyname9 жыл бұрын
Hell yeah, I'd watch a Haskell tutorial series if you made one.
@manateepink91008 жыл бұрын
A video (or videos) on Haskell would be much appreciated!
@narcosnow4 жыл бұрын
Behold! Enterprise grade function plus1! 😂
@paneneto6 жыл бұрын
A series with haskell would be very nice
@bvyas18 жыл бұрын
The last video on Promises was #8. This one is #10. So where does #9 lost .... just line Windows 9 :)
@samerkayali45253 жыл бұрын
Amazing!
@claudrocker9 жыл бұрын
Good video mpjme!
@b3lvo9 жыл бұрын
Hey there, great video! I've always thought that these mechanics are really great in terms of "code-elegance" but they make it much less readable. Wouldn't it be better to write a little bit more code instead of using functors? Anyway I'd love to see some videos on the mathematical principles behind all of this!
@funfunfunction9 жыл бұрын
+Umberto Sonnino It wouldn't be a little more code, though - it would be massive, massive amounts of duplication.
@JohnMichaelReed9 жыл бұрын
+mpjme I think one of the biggest problems with functional programming is that it makes it harder to infer what the author's intent is just by glancing at the code. For example, in Scala, I could write a statement that says "Dog.spot bark volume increase();" and it is incredibly obvious what is going on. "spot" is an object inside of the "Dogs" scope and it has a no-side-effect "bark" method that returns a function object that has a no-side-effect getter for an object whose name is "volume" on which we are invoking the "increase()" method, which does have a side effect (changing the state of the volume). Very intuitive.
@kirillpavlovskii83422 жыл бұрын
Functors is another word for high order functions ?
@j.erlandsson9 жыл бұрын
I'd say it's a Sunday evening show these days! ;-)