I had a fun refactoring example in Haskell today I wanted to share.
So, I've got a structure with a nested
Maybe inside, which looked like this:
Maybe (Vector.Vector (Maybe (Direction, [Departure])))
I wanted to get that second-level
Maybe folded into the first as it didn't provide any semantic meaning.
So I start by writing the type definition: