β€’

tech

My journey before and after Effect

They tell of stories of a far away past where apps where not type-safe, and the only reasonable solution was fp-ts and TaskEither everywhere, with no documentation to help. Then the Effect came, and it all went for good, up to the Effect Days of today.


Sandro Maglione

Sandro Maglione

Software

I am in Livorso right now for the Effect Days πŸ‘‹

Tomorrow is conference day, you'll need to wait for next week for the highlights πŸ”œ

Wait, how did I get here you ask? (To effect I mean, of course πŸ™Œ)

Let's take a step back to 3+ years ago 🫑


package.json before effect

December 2021. I am trying to solve all the same problems, one package at the time:

"dependencies": {
  "crypto-js": "^4.0.0",
  "date-fns": "^2.25.0",
  "date-fns-tz": "^1.1.6",
  "fp-ts": "^2.11.5",
  "js-cookie": "^2.2.1",
  "lodash": "^4.17.19",
  "qs": "^6.9.1",
  "ts-pattern": "^3.3.3",
  "zod": "^3.11.6",
  // ...
},
"devDependencies": {
  "typescript": "^4.4.4",
  // ...
}

I am already all-in into functional programming. fp-ts helps, but it was getting ugly, fast:

import { ErrorMessage } from "app-types";
import * as IO from "fp-ts/IO";
import { pipe } from "fp-ts/lib/function";
import * as O from "fp-ts/Option";
import * as TE from "fp-ts/TaskEither";

export const grpcRequest = <Request, Response>(
  buildRequest: IO.IO<Request>,
  makeRequest: (req: Request) => Promise<Response>,
  onError?: (error: unknown) => ErrorMessage
): TE.TaskEither<ErrorMessage, Response> =>
  pipe(
    buildRequest,
    TE.fromIO,
    TE.chain((req) =>
      TE.tryCatch(
        () => makeRequest(req),
        (error) =>
          pipe(
            onError,
            O.fromNullable,
            O.fold(
              (): ErrorMessage => "Request error, impossible to continue",
              (customError) => customError(error)
            )
          )
      )
    )
  );

fp-ts tamed/typed errors, but not much else beyond that (still better than "plain" TypeScript πŸ™Œ).

Multiple packages where required to fill gaps, together with custom implementations for things like http requests, utils functions, dates and more.

And then effect

The solution at the time was called fp-ts v3. I was on the lookout, but with doubts on what could really be improved.

And then landed effect: A bright future for Effect.

The news is out! πŸ“’ We have made the decision to unite and collaborate on *Effect* as a generational project that aims to create a more cohesive and powerful ecosystem of libraries that are accessible and useful to developers of all levels. #TypeScript

Michael Arnaldi
Michael Arnaldi
@MichaelArnaldi

A bit of an announcement: fp-ts merging into @EffectTS_ together with @GiulioCanti dev.to/effect-ts/a-br…

41
Reply

The exploration started πŸ€”

fp-ts migrations

I started from my (multitude) of projects running fp-ts.

I actually wrote a post about it at the time (now mostly out of date): From fp-ts to effect-ts: How to guide.

So old that I was still using using npm instead of pnpm πŸ™Œ

npm uninstall fp-ts
npm install @effect/io @effect/data

Using fp-ts as a stepping stone helped, a lot. It was not anymore about learning effect (without any documentation or stability whatsoever at the time).

It all came down to migrating a single function at the time. Way easier and constrained problem. Easing my way into effect one function at the time 🫑

Community

Effect has the best Discord channel out there.

Before the official documentation, learning was all inside Discord.

I joined the Discord of effect right away (I never used Discord before that), back in 2021.
I joined the Discord of effect right away (I never used Discord before that), back in 2021.

Effect Days 2024

The day of the announcement for the 1st Effect Days, I had 0 doubts: I got the full ticket right away 🫑

In the months leading to the conference I upped my effect game, publishing content and resources. These were all meant for me to learn (they always are).

A screenshot of one of my tweets about effect in the keynote talk at the Effect Days (thanks again Johannes πŸ‘‹)
A screenshot of one of my tweets about effect in the keynote talk at the Effect Days (thanks again Johannes πŸ‘‹)

After the conference the community kept getting bigger, most modules joined a single effect package, plenty of documentation and resources, and I released a course about effect (Effect: Beginners Complete Getting Started).

Effect Days 2025

All leading to today, here in Livorno, for the 2nd Effect Days. As a speaker this time πŸš€

There is a whole story behind how I came to be a speaker, and how I prepared my talk (TLDR: it's been a long process).

That's a story for later, wait for a future newsletter πŸ”œ


You may have missed the open source release of my Sync Engine for the web:

No other major project in the making, focus all on the Effect Days.

I'll come back from the conference with insights and a new charge for more and more content πŸš€

See you next πŸ‘‹

Start here.

Every week I dive headfirst into a topic, uncovering every hidden nook and shadow, to deliver you the most interesting insights

Not convinced? Well, let me tell you more about it