module Scrabble
( scoreLetter
, scoreWord
) where

import Data.Char (toLower)

scoreLetter :: Char -> Int
scoreLetter letter
    | isIn "dg"    = 2
    | isIn "bcmp"  = 3
    | isIn "fhvwy" = 4
    | isIn "k"     = 5
    | isIn "jx"    = 8
    | isIn "qz"    = 10
    | otherwise    = 1
    where isIn x = toLower letter `elem` x

scoreWord :: String -> Int
scoreWord letters = sum $ map scoreLetter letters

module Scrabble
( scoreLetter
, scoreWord
) where

import Data.Char (toLower)
import Data.Map (findWithDefault, fromList)

scoreLetter :: Char -> Int
scoreLetter letter = findWithDefault 0 (toLower letter) scores where
    scores = fromList $ concat
        [ repeatZip 1 "aeilnorstu"
        , repeatZip 2 "dg"
        , repeatZip 3 "bcmp"
        , repeatZip 4 "fhvwy"
        , repeatZip 5 "k"
        , repeatZip 8 "jx"
        , repeatZip 10 "qz"
        ]
    repeatZip score letters = zip letters (repeat score)

scoreWord :: String -> Int
scoreWord letters = sum $ map scoreLetter letters

Use a Map instead of repeated checks
Use a Map instead of repeated checks
