Internal DSL design in Scala
A domain-specific language (DSL) is a language that you design with a specific domain in mind. There are two types of domain-specific languages (DSLs): external and internal. The former implicates — in the simplest case — parsing a string into the programming language syntax. The latter, on the other hand, involves implementing a language within your own programming language. Quoting Martin Fowler, “Internal DSLs are particular ways of using a host language to give the host language the feel of a particular language”. In this session you’ll see how to implement a simple but complete internal DSL in Scala. You’ll see that Scala syntax has some important features that makes it a DSL-friendly language.
Raising the abstraction level with HKTs and type classes
I suppose it’s an objective of every developer writing reusable code. Statically typed FP and higher-kinded types lets you raise the abstraction level enormously with respect to OOP and, more generally, languages which don’t have HKTs and type classes. In this talk, after an introduction to some funny-named type classes, you’ll see how to take advantage of them to implement a very reusable function. I’ll start by implementing it using a quick & dirty approach and then trying to make it more abstract and reusable thanks to more or less known type classes, actually making sense of them so you can see they are not just confined to theory and useless in practice.
Monad and friends demystified
In questo talk vedremo alcuni dei design pattern del mondo funzionale. Concetti come Functor e Monad possono essere affrontati attraverso due diversi approcci:
Usando una branca della matematica che risponde al nome di Teoria delle Categorie.
Utilizzando un approccio più pragmatico e lasciando i dettagli squisitamente teorici per un secondo momento, quando ognuno si sentirà pronto per approfondire l’argomento.
In questo talk opteremo per l’approccio pratico, cercando di rendere digeribili a tutti gli argomenti trattati.
Infine daremo una rapida occhiata a cats, libreria che, similarmente a scalaz, enfatizza l’uso di questi design pattern funzionali.