- Видео 49
- Просмотров 110 421
Impure Pics
Добавлен 31 май 2012
FP Advocat. Distilling functional programming for the good of all
PureScript for Scala devs
Check out my course “How to think like a functional programmer” - impurepics.thinkific.com/courses/functional-thinking
💡 Useful links:
* Same content as an article: dev.to/zelenya/purescript-for-scala-developers-2o75
* PureScript website: www.purescript.org/
* Getting Started Guide: github.com/purescript/documentation/blob/master/guides/Getting-Started.md
* Discourse instance: discourse.purescript.org/
* Discord server: purescript.org/chat
* PureScript By Example: book.purescript.org/
* Thomas Honeyman Articles thomashoneyman.com/articles/
* Mark's resources: alethic.art/getting-started/with-purescript
* Jordan's PureScript Reference: jordanmartinez.github.io/purescript-jordans-reference-site/
* Pu...
💡 Useful links:
* Same content as an article: dev.to/zelenya/purescript-for-scala-developers-2o75
* PureScript website: www.purescript.org/
* Getting Started Guide: github.com/purescript/documentation/blob/master/guides/Getting-Started.md
* Discourse instance: discourse.purescript.org/
* Discord server: purescript.org/chat
* PureScript By Example: book.purescript.org/
* Thomas Honeyman Articles thomashoneyman.com/articles/
* Mark's resources: alethic.art/getting-started/with-purescript
* Jordan's PureScript Reference: jordanmartinez.github.io/purescript-jordans-reference-site/
* Pu...
Просмотров: 463
Видео
On “superiority” of (functional) programming and other labels
Просмотров 1,7 тыс.2 месяца назад
In this one, I vent about labels, beliefs, and stereotypes about functional programming and not only. #fp #functionalprogramming #haskell #rust #scala Subscribe to Impure Pics: bit.ly/impure-youtube *More Impure Pics* 🐣 impurepics 📦 impurepics.com 👕 merch.impurepics.com *Functional Alphabet book* 📗 Softcover: bit.ly/fp-abc-soft-cover 📘 Hardcover: bit.ly/fp-abc-hard-cover *Watch more...
How to make a quick and pretty PureScript web app
Просмотров 1,8 тыс.3 месяца назад
This video demonstrates a quick way to have something nice running with purescript (react tailwind css shadcn/ui components) Repository: github.com/Zelenya/purescript-shadcn-tailwind-copypaste Check out my course “How to think like a functional programmer”: impurepics.thinkific.com/courses/functional-thinking #fp #functionalprogramming #purescript Subscribe to Impure Pics: bit.ly/impure-youtube...
Scala is one of the best ways to learn Haskell
Просмотров 8053 месяца назад
This video is part of the Haskell & Scala series. 1️⃣ What Scala does better than Haskell and vice versa: ruclips.net/video/K76vrOzU53o/видео.html 2️⃣ Haskell for Scala developers: ruclips.net/video/SpFs9rM1Mcg/видео.html 3️⃣ Scala for Haskell developers: ruclips.net/video/uXo7-AQutck/видео.html 💡 Useful links: * Same content as an article: dev.to/zelenya/scala-is-one-of-the-best-ways-to-learn-...
Scala for Haskell devs
Просмотров 9374 месяца назад
This video is part of the Haskell & Scala series. 1️⃣ What Scala does better than Haskell and vice versa: ruclips.net/video/K76vrOzU53o/видео.html 2️⃣ Haskell for Scala developers: ruclips.net/video/SpFs9rM1Mcg/видео.html 3️⃣ Scala for Haskell developers 4️⃣ Learning Haskell via Scala: ruclips.net/video/_FM_y2gIj0Y/видео.html 💡 Useful links: * Same content as an article: dev.to/zelenya/scala-fo...
Haskell for Scala devs
Просмотров 1,1 тыс.5 месяцев назад
This video is part of the Haskell & Scala series. 1️⃣ What Scala does better than Haskell and vice versa: ruclips.net/video/K76vrOzU53o/видео.html 2️⃣ Haskell for Scala developers 3️⃣ Scala for Haskell developers: ruclips.net/video/uXo7-AQutck/видео.html 4️⃣ Learning Haskell via Scala: ruclips.net/video/_FM_y2gIj0Y/видео.html Check out my course “How to think like a functional programmer” - imp...
What Scala does better than Haskell and vice versa
Просмотров 2,6 тыс.6 месяцев назад
This video is part of the Haskell & Scala series. 1️⃣ What Scala does better than Haskell and vice versa 2️⃣ Haskell for Scala developers: ruclips.net/video/SpFs9rM1Mcg/видео.html 3️⃣ Scala for Haskell developers: ruclips.net/video/uXo7-AQutck/видео.html 4️⃣ Learning Haskell via Scala: ruclips.net/video/_FM_y2gIj0Y/видео.html Check out my course “How to think like a functional programmer” - imp...
Ranking Functional Programming Languages (Why I'm Biased and Excited)
Просмотров 12 тыс.6 месяцев назад
We are making a serious but subjective fp tier list. Same content as an article: dev.to/zelenya/functional-programming-tier-list-4acl 💡 Useful links: * Haskell: www.haskell.org/ * A History of Haskell: ruclips.net/video/06x8Wf2r2Mc/видео.html * Scala: scala-lang.org/ * Functional Program Design in Scala: www.coursera.org/learn/scala-functional-program-design * OCaml: ocaml.org/ * PureScipt: www...
Coding in Haskell | Writing and debugging megaparsec parsers for grep
Просмотров 3 тыс.7 месяцев назад
Try building your own smth using CodeCrafters, my affiliate link: app.codecrafters.io/join?via=Zelenya In this tutorial, we build grep from "scratch" by following a CodeCrafters challenge: we work with megaparsec, debug parsers, and rewrite the same things multiple times. #fp #functionalprogramming #haskell Subscribe to Impure Pics: bit.ly/impure-youtube *How to think like a functional programm...
How (and why) I switched from Stack to Cabal
Просмотров 1 тыс.7 месяцев назад
Check out my course “How to think like a functional programmer” - impurepics.thinkific.com/courses/functional-thinking Stack has been my personal go-to build tool for a couple of reasons. It seems like those don't justify not using cabal anymore. So, I wanted to give it a try. Same content as an article: dev.to/zelenya/how-i-switched-from-stack-to-cabal-3ai2 💡 Useful links: * Cabal Quickstart: ...
The Death of Monads? Direct Style Algebraic Effects
Просмотров 20 тыс.8 месяцев назад
The purpose of monads and their alternatives (old and new). For people who love monads, hate monads, and those who don’t get them. Make FP click by joining “How to think like a functional programmer” - impurepics.thinkific.com/courses/functional-thinking Hate watching videos? Check out the complementary article, which covers the same content: dev.to/zelenya 💡 Useful links: * Doing vs. Being: sy...
Coding in Haskell | Building my own HTTP server in Haskell
Просмотров 2,5 тыс.9 месяцев назад
Try building your own FOO: app.codecrafters.io/join?via=Zelenya In this tutorial, we build a tiny http server from "scratch" by following a CodeCrafters challenge: we write, debug, and refactor Haskell code. 💡 Useful links: * WAI: hackage.haskell.org/package/wai * Warp: hackage.haskell.org/package/warp * Twain: hackage.haskell.org/package/twain * Scotty: hackage.haskell.org/package/scotty * Sna...
The Next Steps in Functional Programming
Просмотров 1,1 тыс.9 месяцев назад
Learn more about FP and make FP click by joining "How to think like a functional programmer" - impurepics.thinkific.com/courses/functional-thinking 💡 Useful links: * The Joy of Abstraction: www.goodreads.com/en/book/show/60658614 * Functional Programming in Scala: www.manning.com/books/functional-programming-in-scala-second-edition * Functional Programming Made Easier: leanpub.com/fp-made-easie...
Common misunderstandings about Functional Programming
Просмотров 2,7 тыс.9 месяцев назад
Learn more about the philosophies of FP and make FP click by joining “How to think like a functional programmer” - impurepics.thinkific.com/courses/functional-thinking #fp #functionalprogramming Subscribe to Impure Pics: bit.ly/impure-youtube *More Impure Pics* 🐣 impurepics 📦 impurepics.com 👕 merch.impurepics.com *Functional Alphabet book* 📗 Softcover: bit.ly/fp-abc-soft-cover 📘 Har...
[Advanced] On error handling in Functional Programming
Просмотров 2,1 тыс.10 месяцев назад
Learn more about happy path programming and make FP click by joining "How to think like a functional programmer" - impurepics.thinkific.com/courses/functional-thinking In this lesson, we talk about errors, where to find them, what works and what not, and then we'll review two techniques I've been using recently (and don't hate yet). #fp #functionalprogramming #haskell #rust #scala Subscribe to ...
How to gently introduce an FP library
Просмотров 1,5 тыс.11 месяцев назад
How to gently introduce an FP library
My migration journey | Let’s talk about Scala 3
Просмотров 975Год назад
My migration journey | Let’s talk about Scala 3
How to introduce Haskell into your company
Просмотров 2,6 тыс.Год назад
How to introduce Haskell into your company
[Teaser] How to use PostgreSQL with Haskell
Просмотров 208Год назад
[Teaser] How to use PostgreSQL with Haskell
Do your Values align with FP Values?
Просмотров 2,3 тыс.Год назад
Do your Values align with FP Values?
Debugging without a “real” debugger (in Haskell and PureScript)
Просмотров 2,2 тыс.Год назад
Debugging without a “real” debugger (in Haskell and PureScript)
How to handle optional fields in PureScript
Просмотров 490Год назад
How to handle optional fields in PureScript
How to write library docs | Iron review
Просмотров 629Год назад
How to write library docs | Iron review
Elixir, clojure??
Debug.Trace is exactly what I needed, thanks!
How is it biased, when they are treated equally? :P
Ah, so rows are just like traits from Scala where you can mix them in.
Don't be a Heyter!
Now this is where it's at!
sloooooooow down 😅
Playback speed control at your fingertips ya bum
You are apologizing and giving ground tucking yourself into you personal subjective opinion corner. I prefer to hear bolder and general statements from you.
I appreciate that for OCaml you mention errors as a usecase for polymorphic variants in OCaml. That is my exact primary use case for them also; as the entire range of possible errors doesn't need to be defined somewhere. Add conflict detection in the database layer in a REST service, and the HTTP layer is forced to deal with this, returning a 409 status code (if the code in between didnt through a retry). Oddly enough, the only other language I've used where the same type of benefit can be achieved is TypeScript using string constants and union types. The only problem is; people who know TypeScript can't read your code if they don't grok FP error handling. But OCaml have GADT that can hide a type parameter when inconvenient, and extensible variants that allow for variants; where the total set of possible values may not be known at compile time. Both of these had their uses in my OCaml unit test framework, speed. GADT to have an infinite hierarchy of scopes with their own type parameters, and Extensible variants to allow the user to attach custom data to test cases; and retrieve it in a type-safe way. The code to retrieve it is a little verbose, so PPX rewriters were written to convert the switch expression into a one-liner.
More videos on this topic would be welcome. Preferably more structured
😂 so pretentious
FP, as every other paradigm, has its strengths and weaknesses. Using the right tool for the job is more important. Yes, if you need to multithread, going for a functional approach is better, but single threaded, complex operations that are to be written maintainably likely are better written in OOP. Don't pick up a hammer and make every problem a nail... Get a toolbox and use the right tool for each job.
Putting stuff in cabal.project is not very useful because Hackage ignores it. You must specify an upper bound for every package, and you must do so in the .cabal file.
As far as I can see nobody misses Erlang in the commets so here I am 😢
please don't stop make content like this
Can we please stop picking on the functional programming bros. They are very busy telling other people they are getting it all wrong, that there is only one size that fits all (hint: it's fp), and also trying to get their very first program to work (without all the other fundamental concepts that you actually need). Moral of the story, abstraction and theory won't get you a job, or a working program.
Ignoring that they're the highest paid developers in the industry and make all the important software that isn't super low level, they know everything you know but you don't know a fraction of what they know. So you should be listening to your seniors. The creator of FORTRAN used his entire nobel prize speech in the 70s to explain why the industry was going on a terrible direction and should focus on functional programming And this isn't a question of what your favorite flavor of ice cream is. Functional programming (or more accurately declarative) has denotational semantics, imperative programming is at best based on the von Neumann system, at worst entirely adhoc nonsense that you just have to memorize. The only benefit to imperative existing whatsoever is to work on the von neuman system aka super low level memory management of a computer that nobody but computer engineers or systems designers need to care about. Well that and side effects which is why haskell is often called the best imperative language. So yes objectively it is better at practically making software. It's safer, faster, more expressive, scalable, etc. It could be logic programming or declarative OOP if you want but all those things are backed in this scary thing called math. Other engineers are required to know math to stay certified you know. Just be happy you live in a time where somebody with a 4 month boot camp who doesn't know an ounce of computer science or know how to make anything but a tutorial-fed CRUD app can call himself an "engineer". It won't last forever
This video is such a huge work, big thanks to you. I'm surprised that here was no comments and mine is gonna be the first. I'm relatively new to Haskell coming from C# where everything is kind of monopolized and ready to use, so, I did not put much effort into picking tools, because I didn't have to. Haskell is different, thank you for helping people like me to dive into this beautiful language. This is the first video on this channel, that I've seen, so, I've checked out the other videos and I'm actually interested in your work. New subscriber right here. Thanks again!
Thank you for the kind words and good luck on your journey!
The sealed trait sum type pattern is not the same thing as the enum pattern. They're two different sides of the expression problem and both are necessary depending on if you're looking for behavior extensibility or case extensibility
讨论形式语言就不能正经学点数理逻辑么,函数式编程的表达能力来自其与证明论的紧密关系。跟古代工匠一样发言,能说明白才见鬼了。
Agreed. There's this weird focus on trying to talk about fp like it's a JavaScript framework and it's likely because of all the bad developers who love to attack FP for "not being practical". Math is scary to them
感觉视频不旨在讲明什么是FP, 更像是说理解到,FP的严谨在实际操作中不一定就是最优的,这种意思。
@@clementdato6328 老是又用计算机当纸用, 用来约束湿件, 又用计算机当自动控制器, 用来服务人类, 这样既要又要如果混成一团, 不做区分, 那函数式就是不太好用, 因为函数式里面步骤和时间不在一起, 你得自己解决怎么耦合的问题. 但你不用函数式, 这个耦合必然有个边界, 也就有了嵌入式程序员, java程序员, C++程序员, 还有35岁技术过时被开了.
functional programmers aren't inherently superior compared to other programmers, but functional code is inherently superior to imperative code
The thing is FP makes people who do it think they are smart and for a good reason. But some people start to attribute that feeling of "smartness" and explain it by "superiority" which is just a bias in the end.
There is one thing where a subset of FP (total functions) is superior to everything else - writing *provable* code.
Well articulated. Good style and structure.
As Tony Hoare said in 1968, we need to know *what effects* a procedure / function has. Having *no effects* accomplishes this goal, but it's more extreme than necessary.
@@AndreiGeorgescu-j9p Managed effects sounds like a good idea. 🙂
Blasfemy
I am a functional programmer myself, however, Functional has its weaknesses. The main weakness of Functional is that it is not so good at lower level operations like memory manipulation. The other thing is that because of this it is less performant. So currently we still need to have lower level procedural (C or Go) or functional inspired (Rust) languages. I think the future of software engineering is some functional language that respects the underlying computer architecture. So maybe a functional language that can compile to optimized procedural code... Similar to Roc or something of that nature.
@@Nellak2011 yeah, I’m almost on the same page, I don’t think there’s ever going to be ONE language to rule them all. More like specialized services connected with services that are more pleasant to write/compose: ruclips.net/video/5dces2JfsFo/видео.html
It's probably good to remain open. I have to try it some day.
On the other hand, functional programming make for great control-plane languages. Drop down to what is best for the job. Doesn't OCaml make for a half decent systems programming language, btw? Roc looks awesome.
It's the computer's job to respect code not vice versa. That's why compilers exist and why fp can give you optimizations imperative can't automatically
I liked codecrafters, but it is quite expensive
I love this video. It is unafraid to introduce lots of great functional languages, even some you may not have known!
Very good chapter. I'm going through your course after reading Learn you a haskell. Great to see Applicative Functors and Monads finally in "real" practice !
Bro you don't get the concept of a tier list facepalm
Seems kind of annoying to have to write your own bindings for the source code. Is there no way to automate that process? I'd like to try PureScript, maybe with React, for UI apps but this feels like doing double the work. I get that writing business logic in a more tightly constrained language like PureScript is beneficial over TypeScript, but this seems like you have to maintain two implementations almost.
@@GallowsofGhent it is annoying. But, in theory, only has to be done once: you can share this between project, share the code with friends, and also publish it (most popular libraries have the purescript wrappers already). It’s getting come to use AI tools for this, they spit out the whole boilerplate in seconds. A couple of people are/were working on the tools for automatic generating. But even in worst case, you shouldn’t be doing the work twice. Someone else does the work on js/ts side and you only do FFI boilerplate on ps side. If by double work you mean declaring types/interface twice (on ts and on ps side), yeah, it’s technically double the work and it is more work than using js/ts from js/ts directly, but I’d argue it’s only a short term saving. Most of the time the most consuming work is body/logic-related. That’s why I tried to emphasize that it’s a case by case thing.
Tldr. There should not be two implementations
When you do this work, you understand how the component works (its props/options) much better. I always find it fun to make FFI bindings, as I explore the original thing and scope API to my particular needs.
@@impurepics I see what you mean, you kind of expect these bindings to b community-supplied. These types of 1 to 1 bindings seem easy to automate though, thinking about something like a monorepo code generator feature. I guess you also rely on other devs to have done the work once and kindly add it to the giant repo in the sky.
@@GallowsofGhentcould be worth starting an open source project like that
Dude chill :)
Playback speed control at your fingertips ya bum
Thanks for posting some Purescript. I’m really trying to get Purescript to catch on.
This demo would not be here without github.com/rowtype-yoga/purescript-react-basic-dom-beta and the author of the library
4:08 do-notation is what?
On my last attempt to install Haskell, I was like "ghcup? What is this? People think this is worse than python???"
This is what the politicians call a "hearts and minds" issue. Right now, people want to program in whatever could net them a high paying job. Haskell could be the most beautiful and useful language in the world, and they would parrot these talking points just because there has to be SOME reason why it's not a top 10 language. But let someone write a library in Haskell that creates a gold rush (imagine: Haskell on Rails...lol), then they'd be interested, then they'd start making up new stories about why Haskell is the best language. TL;DR: the mob is fickle.
This talk is really confusing, since it does not give an impression that the speaker knows what monads are. Weird.
@@vpatryshev knowing what monads are and knowing why monads are used are two different things. I assumed people watching are familiar with the former, and the later is important for talking about a bigger picture
I liked the animations. Unless Scala has monad transformer stacks, it wouldn't be helping me learn what's actually hard about Haskell.
Thanks, I'm trying something new. And, yeah, you can check out the cats library, which has the most popular transformers (for example, typelevel.org/cats/datatypes/eithert.html and typelevel.org/cats/datatypes/statet.html) Moreover, when you get tired of monad transformers, you can try cats-mtl (and get tired by that and so on ;) )
Funny. I went the other way around. Java -> Haskell -> Scala :) Both Haskell and Scala are good languages to know <3
3:10 do you plan on covering Roc anytime soon? i really like it's language design choices
@@bighomem yeah, I want to play with Roc myself soon too
@@impurepics cool! i look forward to watching the video when it drops :)
No higher kinded types so just a toy language in comparison to most other fp
3:08 i did learn Haskell via OCaml as I had some experience with Rust prior. And Rust and OCaml share a lot of common aspects while OCaml still introduces most of the functional programming topics. I would recommend going to Haskell through OCaml for Rust and Swift devs as they both were inspired (even indirectly) by OCaml
Scala is a good way to prepare you for Haskell compile times.
Java can also model ADTs through sealed inerfaces and records.
Oh lookie, a video about an opinion I already hold.
I wouldn't watch it in fullscreen
This one video made me subscribe!!! Love how u pointed out that Haskell was lazy and hence needs monad for io
@@generalyoutubewatching5286 Thanks, I’m glad you enjoyed it; bunch of people hated that part 😀
ELIXIR wasn't there because it's in an S++ tier.
because we have Gleam we don't need Elixir...Gleam is the better Elixir Jk Elixir is amazing ...for stealing libraries and using it in Gleam XD
Honestly i don't get functional programming hype, i'm no hater, i try to learn srust which implements some of the functional patterns, so i'd like someone to sell me on it
@@LilianaCodes I don’t consider Rust to be very functional. I wouldn’t sell it to anyone. It’s fine not to get fp. If you’re not struggling or annoyed with the languages/programming you’re working with, then you don’t have to buy-into functional programming. Otherwise, you could try looking at those problems and see if/how functional programming can solve those. And go from there… For instance, I HATE when I need to find a bug or decipher some logic in Ruby, I have to go through all the modules, all the classes, all the methods that have anything to do with the piece of logic I’m looking at (you can’t trust anything not doing something weird). On the other hand, when using any of the languages mentioned in the video, I don’t have to do that. It’s easier to isolate relevant snippets and go to connected relevant functions (see local reasoning). I think it’s hard to get it just by reading about it, you have to experience it. And YMMV
@@impurepics many thanks, and yeah rust isn't functional but it includes some functional patters, also i want to try in the future a lang like gleam to see what the hype is about, do you think that one is a good show?
@@LilianaCodes yeap, gleam could be a good one to pick up
@@impurepics thanks
isn't typelevel more for Tagless stuff than transformers?
Good call on not mentioning, that many code bases are still on Scala 2 and use things like play! or Akka. :) I actually don't know how to feel about things like cats-effect. Nor "direct-style". We'll see how that develops, maybe it's going to be a simpler solution.