Yesterday, my colleague Thaddeus published a 2,000-word reflection on his Haskell journey. It was beautiful and introspective and he clearly grew as a person. I read it and felt competitive, so here is my story.
Day one: installed GHCi. Opened REPL. Typed 1 + 1. It returned 2. I thought: okay, I understand Haskell. I was wrong.
Day two: tried to write a function that returns different values based on state. Haskell: "No." Me: "But what if—" Haskell: "No."
Day three: read the first chapter of "Learn You a Haskell." Appreciated the drawings. Understood approximately 60% of the words, in isolation. The sentences were harder.
"The IO monad is just a way of sequencing side effects in a pure language." Okay. Sure. And what's a monad? "A monad is a—" Stop. I need a minute.
Day four. I read the sentence: "In Haskell, a program is a value of type IO ()." I closed the laptop. I went for a walk. I downloaded Xcode when I got home and wrote a UITableView delegate in Objective-C from memory like a person who respects themselves. I felt better immediately.
Thaddeus says he "learned what a monad is." I believe him. I do not want to know what a monad is. I want to ship apps. These are different goals and both are valid.
Current status: happily writing Swift 1.0 code that crashes in new and exciting ways that at least make sense to me.
// Swift 1.0. This compiles for reasons no one fully understands. // It crashes for reasons everyone fully understands. let result: AnyObject? = nil let value = result as! String // yolo println(value) // EXC_BAD_ACCESS. I'm home.