How to handle optional fields in PureScript

Ғылым және технология

Hate watching videos? Check out the complementary article, which covers the same content: dev.to/zelenya/how-to-handle-...
This tutorial shows how to handle optional fields using the undefined-is-not-a-problem library.
💡 Useful links:
#fp #purescript #react
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 Impure Pics
• Debunking Haskell Myth...
About Impure Pics
FP Advocat. Distilling functional programming for the good of all
Get in touch: zelenya.com
0:00 Why?
0:45 Optional values in PureScript
1:41 Undefined is not a problem
1:55 (Skip unless you’re following at home)
2:42 Zero cost coercion
3:19 Boilerplate coercion
4:32 How it works
5:05 [Bonus] Additional type-safety
6:08 Footer

Пікірлер: 8

  • @i-am-the-slime
    @i-am-the-slime Жыл бұрын

    Love it!

  • @PaKa-kj3rj
    @PaKa-kj3rj Жыл бұрын

    Hey mate - Would a Purescript series be on the cards potentially? Wanting to move away from dart/flutter and mostly just OOP/imperative yucky-ness but resources for making the transition are pretty scarce (especially when considering purescript/react). Subscribed anyway, love the content thank you!

  • @impurepics

    @impurepics

    Жыл бұрын

    What kind of series do you have in mind? Any specific topics? Something like building a react app with PureScript? I do have it on my list. I focus on making introductory FP videos/articles right now, including some PureScript topics. A full course or a series is in the back of my mind, but it will take some time. I can also recommend book.purescript.org and github.com/purescript/documentation, as well as joining PureScript discord (linked in the docs).

  • @PaKa-kj3rj

    @PaKa-kj3rj

    Жыл бұрын

    ​@@impurepics​ Hey there, thanks for sharing that! For me personally, I can't grasp some of the specifics you touch on largely due to not being able to wrap my head around the various aspects of the eco-system. I'm sure there would be quite a few others in the same boat. This makes getting started a bit more challenging and perhaps discouraging. The specifics of each aspect is not out of reach (like the links you shared), but again - it's just figuring out how it all works together. Even just a high-level overview of the ecosystem, how purescript, halogen, react etc work together, package management etc. It might also provide context to some of your other content too :) As far as a series, I'd (and I am sure others would) totally pay for that. Cheers!

  • @PaKa-kj3rj

    @PaKa-kj3rj

    Жыл бұрын

    @@impurepics Just a thought... I guess the other thing that I'm sure many would like to know is how react + purescript would compare to something like flutter or plain react. Whilst for the moment, we happily abandon OOP garbage for a functional experience - what trade-offs, shortcomings and compromises might we face in terms of packages, language maturity/features/issues, community support etc.

  • @impurepics

    @impurepics

    Жыл бұрын

    I see! Thanks for sharing. I'll try to cover something like this

  • @PaKa-kj3rj

    @PaKa-kj3rj

    Жыл бұрын

    @@impurepics Cheers!

Келесі