this post was submitted on 02 Aug 2023
2 points (100.0% liked)

Haskell

8 readers
1 users here now

**The Haskell programming language community.** Daily news and info about all things Haskell related: practical stuff, theory, types, libraries, jobs, patches, releases, events and conferences and more... ### Links - Get Started with Haskell

founded 2 years ago
 

Which error message do you find easier to read?

GHC-style:

Hangman.hs:46:32: error:
    * Couldn't match type '[Char]' with 'Char'
      Expected type: Char
        Actual type: String
    * In the first argument of 'makeGuess', namely 'letterInput'
      In the first argument of 'gameLoop', namely
        '(makeGuess letterInput gs)'
      In the expression: gameLoop (makeGuess letterInput gs)
   |
46 |       else gameLoop (makeGuess letterInput gs)
   |                                ^^^^^^^^^^^

Elm-style:

-- Type mismatch ---------------------------------------------------- Hangman.hs

46 |       else gameLoop (makeGuess letterInput gs)
                                    ^^^^^^^^^^^
Couldn't match type '[Char]' with 'Char'

Actual type:

    String

Expected type:

    Char

#haskell #programminglanguages

you are viewing a single comment's thread
view the rest of the comments
[–] user75736572 1 points 1 year ago

Probably the first