Skip to content

Code Less and Do More with Functional Design Patterns

Photo of Damian Nadales
Hosted By
Damian N.
Code Less and Do More with Functional Design Patterns

Details

The topics of this Meetup will revolve around some functional design patterns: what are they for, and how can they help improving your code. These concepts are not exclusive to Haskell, and we hope we can show them in such a way that you are able to see how they can be translated to your language of choice.

Remember that there is a poll section in the Meetup page of this group where you can answer some questions that can help us to better shape the contents of the coming meetups.

And for those of you that'd like to learn a bit more of Haskell, we're also active with a self-paced, do-it-at-home Haskell course, which you can find here:

https://github.com/EindhovenHaskellMeetup/meetup/tree/master/courses/programming-in-haskell

We're a bunch of friendly people at the gitter channel, so feel free to join in and start learning.

I hope to see you there!

Program:

18:00 Food

18:30 Damian Nadales - Functors, Monoids, Applicatives, and Monads: What, Why, When, Where?

19:30 Gabriel Volpe - Functional Data Validation

20:30 Drinks and closing

Functors, Monoids, Applicatives, and Monads: What, Why, When, Where?

"Good programmers are lazy", says the adage. We're constantly looking for better ways to reduce the amount of boilerplate in our code. Functors, monoids, applicatives, and monads are some of the functional design patterns that allow us to do just that.

In this talk I'd like to present some examples of the mechanisms that these abstractions implement and the problems that they solve, showing that they could have occurred to you, and they are not as scary as they seem, in spite of not having more friendly names like the "fluffy bear pattern".

Functional Data Validation

Everybody needs to validate something. From the content of a file to a webform. Luckily in Functional Programming we have the tools to make this work enjoyable. In this talk I'll show you some different ways of validating data, depending of the need, using the data structures described below.

  • Simple validation: using the Maybe Monad

  • Validation a bit more descriptive: using the Either Monad

  • Validation with a full report of errors

  • Creation of a structure capable of accumulating errors

  • Involves topics like Semigroup, Functor and Applicative

At the end you'll have a Haskell project with all the code shown in the talk to play around with.

Disclaimer: It is not necessary for you to know about the typeclasses mentioned above like Semigroup, Functor, Applicative and Monad. When you see this in action you'll understand what it's used for and that's all you need for this talk!

Photo of Eindhoven Haskell Meetup group
Eindhoven Haskell Meetup
See more events
Sioux Embedded Systems
Esp 405, 5633 AJ Eindhoven · Eindhoven