The Hard Part of Learning Haskell

2025-01-25

I got inspired by a blog post The Hard Part of Learning a Language by Hillel Wayne. Now, obviously, one of my favourite programming languages is Haskell and I wanted to answer the questions raised on the blog post to my best effort. I’ve been using Haskell for personal projects and programming tasks for a bit over two years now, which probably doesn’t make me the most qualified person to do this, but I’ll give it a go. Rather than giving complete answers on all but the simplest cases, I’ll try to lead you to other resources. If you have any suggestions, please send them by email and I’ll have them added (accredited, of course).

How do you install Haskell?

How are you supposed to write Haskell?

You may use your preferred text editor/IDE (remember to install HLS):

How do I do $COMMON_OPERATION in Haskell?

Some code examples to get you going.

import qualified Data.Text.IO as T
main = do
  content <- T.readFile "/path/to/file"
  T.putStr content
import qualified Data.ByteString as BS
main = do
  content <- BS.readFile "/path/to/file"
  BS.putStr content
main = do
  content <- readFile "/path/to/file"
  putStr content
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
import Data.Aeson (encode, decode)
import GHC.Generics

data Format = Format 
  { name :: String
  , fileExtension :: String 
  } deriving (Show, Generic)

instance FromJSON Format
instance ToJSON Format

main = do
  let (Just f) = 
        decode "{\"name\":\"JSON\",\"fileExtension\":\".json\"}"
  print (f :: Format)
  print $ encode f
import Data.Time
import Data.Time.Format.ISO8601
main = do
  now <- getCurrentTime
  print now
  past <- iso8601ParseM "2025-01-25T14:15:00.000Z" :: IO UTCTime
  print past
  print $ diffUTCTime past now

What are the language quirks that will cost me an hour to discover?

What are the things that are just different enough from what I’m used to that will confuse me?

What parts of the core language should I avoid at all costs?

How to get help?

There’s active Haskell communities in the following mediums: Discord, IRC/Matrix, Reddit, Discourse

What resources to use for learning Haskell?

How to debug?

Testing

How do I build? How do I package? How do I manage my environment?

How am I supposed to “properly” organize my project files?

This is explained well by Steph Diehl.

So… the language community

What innocuous-seeming topics always turn into a flamewar? Is my question even safe to ask?

Now they’re explaining something way above my head. Is this necessary to get, or are they just cursed with knowledge?

You’ll see a lot of math and category theory jargon (learning them is usually not essential, but might be interesting).

What opinions do they have on other programming languages? Are they going to look down on me for writing a lot of Python?

You won’t get looked down. The community is small and even slightest interest is usually very welcome.

Do they think I’m subhuman scum for using Windows?

No, although the experience on (native) Windows may be a bit rough, some libraries may not work etc. Generally Linux is more widely used in the community. WSL might work just fine, but I don’t have any Haskell development experience on Windows.

What are all these in-jokes supposed to be?

Conclusion

My goal for writing this post was to get a better understanding of the Haskell ecosystem and community from a beginner’s perspective. I consider myself an intermediate Haskeller, but I’m continuously learning. I hope you found this post helpful!

Back to Posts