Paulo Suzart FP and more software engineer | functional programming fan

Jooby, RxJava and Hystrix

RxJava is an implementation of ReactiveX, the ubiquitus API for dealing with reactive streams. There are much more languages supporting the API, including .NET, Scala and Others.

Combine it with lightweight and modular web frameworks like Jooby, and we may be facing one of the best combos possible nowadays. Add to this recipe a good circuit breaker (Hystrix) and you are good to go. Let’s take a quick look.

Continue reading...

Exploring Optional Types in Java 8

Let’s see how implementing Binary Tree Depth and Breadth Search feels like using Java8 lambdas, Optional and things related.

In this posts we’ll also see vavr Option type and List!

Continue reading...

Why Crystal Is Awesome

Few months ago posted again about Racket and created a simple cod to remove docker tags from Dockerhub using this language. This time We’ll do the same but using Crystal Language as a background to talk about this language.

Continue reading...

An open letter to less experienced developers - Page 2

In the last day of 2017, a usually melancholic day, a sincere letter came up with the title: “An open letter to less experienced developers”. And I need to confess that I read about myself and my career in that letter.

Continue reading...

Removing Dockerhub tags with Racket

Believe it or not the most viewed blog post of all times is Why Racket is Awesome written in 2015. I also don’t understand why that dense post is the top one. And to boost the interest for Racket, I’ve decided to implement a small simple utility to prune Docker tags. This way we keep only the most recent k tags. Let’s check it out.

Continue reading...

Watching Bitcoin price with Typescript and Typedi

In my last post I presented a summary of Typescript ecosystem and some important players in the field like typedi. In this post we’ll check typedi features and to make things more interesting, let’s create a simple client to watch for price changes in a given market.

Continue reading...

Type Safety, ORM and Dependency Injection with node.js

This time I’ll share direct knowledge from day to day job with node.js and TypeScript.

You probably know I come from Java world. Did JVM stuff from 2004 to 2016 without a break. So you might think I miss the static type check, etc, right? And yes, wouldn’t say missing is the right word, but I think it brings a lot of advantages!

Continue reading...

Sangria without case classes Part II

This is a sequel of previous post Sangria without case classes where I’m exploring shapeless in conjunction with the awesome Sangria lib. Mind this is total exploration and chances are (actually very likely) that it is possible to do simpler code to achieve the same effect.

In this post we will see shapeless HMaps and again, use the sangria-akka-http-example as basis for our adventure.

Continue reading...

Sangria without case classes

In my previous post I talked about how easy it is to implement a dynamically generated GraphQL Schema using graphql-js as you can simply ignores types and do your job. I then made some comments about Sangria, perhaps the most stable and powerful GraphQL lib for Scala. Follow me in this exploration until I find a solution or a good soul can share it with us.

If you refer to the sangria-akka-http-example project, you’ll see the hand made schema. Something like:

Continue reading...

GraphQL, yes I'm in!

GraphQL is without a shadow of a doubt the latest cool thing in the fields of providing a API. It’s not a total novelty, given that it’s been around since 2015 (publicly) and in theory, it’s some how running on Facebook since 2012.

In summary, GraphQL gives clients the power to decide what they want, including to fetch related data at - virtually - any depth level. How they do that? The answer is a query language instead of meaningless JSON payloads and blind REST like endpoints.

Continue reading...

Dependent Types And Safer Code

I’ve recently joinned a Discord Functional Programming Server. No, it is not a framework for developing servers using functional programming languages. Instead, a mix of IRC and Slack for discussing several functional langs. If you want to watch and participate in nice discussion and tips about clojure, elixir, elm, erlang, haskell, idris, lisp, ocaml, racket, and scala, join the server right here.

I’d heard about Idris long ago, but after joining this server I was surprised by a very active channel, the #idris channel. And one of the latest messages presented a gist with Type Dependent printf function. At first may sound like a silly thing, but that was a nice opportunity to expand my mind around Type Dependent code beyond what is taught in the Idris Tutorial.

Continue reading...

After D comes C++

As mentioned in my previous post, we may be openning our GraphQL Grammar (using PEGGED), and interpreter to generate compatible pure D Abstract Syntax Tree.

While we don’t have any decision, let’s talk about D and Why I ended up building an entire server in C++.

We were looking for a compiled language with powerful type system for OO purposes (That’s why dropped Go), that wasn’t Java. With Scala going down the hill, there was few options that could make any sense. They were D or C++.

C++ has a myth that it is complex and hard (well, it might be sometimes), so we picked up D!

Continue reading...

15 languages and counting

Hello there, happy new year! In this post I’ll talk about the programming languages I got involved somehow (either for serious playing or serious business).

Yes they are 15. I started my passion for programming languages almost 10 years ago with Scala. At that time I had been working with Java for 4 years. To be fair, the only existing language in my mind was Java. Then Scala comes into play.

Here a present you them in a loose chronological order.

Continue reading...

CRUD like Redux Abstraction

I recently played the role of a front end developer. You know, I’m not one in a broad sense. I have not my head wrapped around CSS and visual stuff. But I made it reasonably well using the following toolkit:

  • ReactJS - A javascript library for building user interfaces
  • Redux - a predictable state container for JavaScript apps
  • Material-UI - A set of React Components that Implement Google’s Material Design

Continue reading...

One year as remoter

Ok, you are used to long time without posting, so no need to repeat it! Anyway, as you know we half accidentally moved to Colombia last year, and now it’s been a year since we left São Paulo, Brazil.

I’ts been quite great experiente, but in this post I’ll talk about how it is like to be working as a remoter.

Continue reading...

Django + Postgres + Redis + Knockout.js. Nice shot!

Good News

Hello from Colombia! Yes, we came to Colombia in order to my wife delivery our baby. Awesome! I’m also investing some resources on a new company: Panda Team. This is a quite old dream, to have my own small company and work hard to help customers succeed in their business. Visit us!

Continue reading...

Database Functional Mapping with Slick

Typesafe guys certainly gave nice shots embracing projects like play!, akka and Slick.

After finally swallowing the huge change they did on play! itself since its release 1.2.4, I’ve been heavily playing with play! 2.4.3. I like the ability to use different persistent frameworks, but so far, it comes with the cost of sparse documentation and lack of focus on a single well understood solution and all the caveats.

Continue reading...

How Much Functional Are You?

Whats up? Fine? Well, I don’t know exactly why but I ended up reading the Feature Overview doc of the great Shapeless Scala lib.

Continue reading...

Give Kotlin And Quasar a Try

Hello hello! After a quick incursion into the world of Rust language, I’m back!

The balance since last year when I started to work on a tracking system written in Go is: I didn’t finish it (as if it is novelty). Also, I had the opportunity to deliver a danjgo system to production with easy. I might return with the tracking stuff but not written in Go.

Continue reading...

Why Racket is Awesome

Finally 1st post of the year! Well, not that much to say lately. But here a piece of my sensations while playing with Racket last two weeks.

Continue reading...

Going back to Go (golang)


Hi people, a while ago I made a clear expression of my kinda frustration with clojure ecosystem in the clojure mailling list. I’m not going to share the link here because my post itself was confusing and answers even more.

In summary the furstration comes from TOO TOO TOO MUCH '[ANN]' posts on the list as if it was open source and more specifically, few of them are really bringing value to clojure as other languages have strong libs/tools.

Continue reading...

Sliding Window events with Clojure

Hello all, I’m back to clojure posts again. :)

I was looking for a sliding window processing of events. This is something very common in the world of Complex Event Processing that can be roughly translated to querying events adding a time dimension to the query.

We can easily find some great products/libs namely: The excelent Oracle CEP, Jboss Drools Fusion, Esper, and the very useful Clojure Werkz EEP, Embedded Event Processing.

Continue reading...

My Contribution to Puppet Forge

Happy new year! This time I would like to share with you that I’ve just shared a Puppet module at Puppet Forge. That is awesome!

As you may know, I’m using puppet to manage my own manage resources. You can find all these manifestes my git hub at There you’ll basically see some resources to setup, update and keep a bunch of packages and and configurations. That sort of thing you don’t wanna miss next time you format your laptop, or when you evolve the current one.

Continue reading...

Puppet good pattern?

Hi all! First note: Puppet definitely goes beyond what is written here. Also, I’m far from being a puppet specialist, and after posting about Ansible, I’m writing about puppet because it is my main tool.

While translating a Ansible playbook once used to setup a developer machine - if I can call it rewrite - I found myself often using the same patter: Using create_resources function + pure hashmaps.

Continue reading...

Understanding Clojure apply and partial

Hi guys, a really introductory post on Clojure apply and partialfunctions. I need to confess that I didn’t take a look around to see how people are usually explaining these functions. For sure there are better ways to explain it even usingJavascript, but remember: it was used to teach a beginne, so no purism here.

Anyway. These sample js codes come from the explanation I gave to a colleague at work. And pretty much worked to illustrate both cases.

Continue reading...

Ultrafast web development with Perl + Bootstrap + MongoDB

Few weeks ago I had to fix some perl scripts. Actually make some HTTP requests, etc.

That was actually my first contact with the language. Never tried before! How can it be? Well, I ended up finding an amazing community and ecosystem (mostly covered by CPAN).

By ecosystem, I mean libs and tools out there. Couldn’t be different since it was created in 1987 (I was just a kid)!

So, I needed to develop something simple yet powerful enough to be further extended with new features. But the main requirement was: DO IT RIGHT NOW!

Continue reading...

Geocoding CSVs with Clojure

Hi! Nothing like delivering some value to your company using your preferred tool, hun?

Well, I had this feeling after freeing up my team of writing and writing the same thing again and again. As you can seen at ultimate-geo project page:

Ultimate Geo is the final definitive geocoding app. The motivation behind it was: We have different CSVs full of address in the most crazy combinations. Some of them has the street, number, site, phone. while others have same columns in a different order, etc. This led us to keep creating (actually adjusting) our geocode scripts. Now it is over.

Of course it may not fit everyone’s needs. But helped my scenario a lot.

Continue reading...

Docker + Ansible

Hi! This form for blog posts title is working! Liked it.

Again some time without writting. And this time I’m writting about something brand new: Docker.

It lies in the virtualization context. You can read more at docker documentation. And from my point of view, it comes to kill some important challenges me and you have been facing over years when talking about delivering software.

Continue reading...

Janus + ack-grep + fish shell: Tools to rule everything

Hello, I’m posting as often as the men go to the moon! Sad. For a good reason, though. We are having great times at Guiato.

What I bring today is the set of tools I’m using nowadays for developing Grails and Clojure at work.

Editor (gVim with Janus)

I used Sublimetext for almost two years at home and at work. I really like it, but if I understood well, the version 3 is available for purchasing only. And, you know, you have a vim editor. Why not?

Continue reading...

Configuring Clojure Immutant by environment

Hi again! Not posting for too much long.

Well, this time we will explore the clojure’s ability to load arbitrary files as code.

This is such an amazing feature, but you should be careful. Don’t start reading anyones files and evaluating them into your app. Be wise and use it for specific situation like this: I wanted to load a bunch of configurations (and even funtion calls) depending on the environment my app is running.

To do the conditional evaluation, I decided to add an extra key to :immutant entry in my project definition. The entry :env is an arbitrary configuration value. Lets take a look:

Continue reading...

TCP Server with Clojure Aleph and Gloss

Hi Ho! Its been a long time without writing here. As you might know, I’ve just launched a new web/mobile (Guiato) platform to help retailers reach their customers with their existing brochures/pamphlets/flyers but now, electronically.

It was as a 4 months adventure, including 20 days in Germany to plan and bring all the platform to Brazil. But now it is time to clojure a bit more. And we are just beginning.

Continue reading...

Monitoring ec2 with clojure and Server-Stats


Before going further, please take a look at Parallel SSH and system monitoring in Clojure.

Combining my need for monitoring an EC2 instance running nginx, bamboo and artifactory, with my will to code in clojure, I have decided to use server-stats to basic monitor my server via ssh.

Continue reading...

sorting with clojure comparator

This is a quick post to show an example of clojure comparator for sorting a list with sort.

At work a friend wrote dozen lines of java to sort a list of characters that represents t-shirt sizes. The sizes are: pp, p, m, mm, g, gg, a, aa. Where ‘pp’ is super small, ‘p’ small, ‘m’ medium, etc.

Some shees have all the sizes available, some not. So imagine a shirt with just g, a, gg, p sizes availabe. The screen should show: p, g, gg, a.

Continue reading...

lazy-seqs from database with clojure korma

As you may know, I’ve started in a new company last early this month. It is being a huge change in all aspects, technology, people, process, environment, etc.

Well, this week I wanted to migrate some data (900k rows) from a MySQL database to a Postgres one. @felipejcruz recommended py-mysql2pgsql, but I wasn’t able to put it to run with dependency - or whatever that messages were - errors. Then I tried SQLFairy, but does not migrate data, just the schema ddl and other cool features (worthy features).

Continue reading...

Web Noir plus enlive template

Hi again! Long time without writing here. But for a good reason.

One of the most promising web frameworks for clojure is noir. It is actually an abstraction on top of ring and Compojure, both successful clojure products.

By default, noir comes with the excellent hiccup, which allows one write html in clojure like this:

Continue reading...

Clojure macros: Automating AWS SimpleDB admin tasks.

First post of the year! To talk about clojure, of course. I’ve written (pt_br) about clojure macros before. And yes, it is really powerful.

I’m using macros to help me setting up a connection with Amazon SimpleDB to do some small administrative tasks such as listing domains, creating domains, counting items in a domain, etc.

SimpleDB hasn’t a console, so you have interact with it using a pure html + js application provided by AWS, or do it by hand. I do prefer doing it by my own :). Then I created de following macro:

Continue reading...

My Own REDIS Types - text - Notation

Some seconds after the last post, @paraseba commented that a text version of this notation may be even more helpful.

Here it is:

  • $ means provided by some interaction with redis.
  • * means provided by user.
  • key represents a redis KEY with the value set by SET.
  • (listkey) represents a redis LIST with elements manipulated by LPUSH and so on.
  • {hashkey [key values]} represents a redis HASH with data set by HSET or HMSET.
  • #{setkey data} represents a set or sorted set.
  • as $varname may be used for situations where INCR is used to generate an ID.

Continue reading...

My own REDIS types notation

One of the greatest NoSQL key-value databases I value most, is redis. It is simple, fast and tasty.

You interact with redis through its protocol. They are divided by commands that you can apply to its different data structures. These structures are Key, String, Hashes, Lists, Sets, Sorted Sets and channels (this one used for pub/sub pattern).

Since redis is key-value, it means you can store only keys with values. Right? It may sound bad at the beginning, but you get the way as you try. I’m just a newbe in redis world and I’m feeling comfortable with it.

Continue reading...

Korma and clojure records

Korma is a clojure framework (by @ibdknox) that provides great SQL abstractions. You can work purely with clojure code without inserting SQL strings into your code.

Consider the following entities:

     (defdb mydb (mysql
                         {:port 3306
                           :host "localhost"
                           :user "root"
                           :db "korma_post"}))

    (defentity email
	    (database mydb))

    (defentity person
	    (has-one email)
	    (database mydb))

Continue reading...

DateParamMatcher for Finagle

Twitter Finagle is an amazing framework for RPC communication, and my interest is its HTTP features for creating RESTful APIs.

As I bloged at codemountain, I’m using finagle for a personal project. Don’t know how far it will go, but the facts is that I’m learning Finagle a lot.

During this project I needed to extract from the query string, a param to be parsed to a twitter.util.Time. I ended up with a Param Matcher to be used my a pattern match agains the requested path. The use of this Param Patcher is:

Continue reading...

What you are supposed to find here

Hi, this is another blog of mine. Yap, I have a - mostly in portuguese - wordpress called codemountain, and a Posterous. Maybe I move to here and kill the others. Don’t know yet.

The main reason to starting blogging directly on my Github is to keep the subjects even more focused on projects committed here, and share some experiences with some libs also committed here.

Continue reading...