Is there any other ways to use variables outside of the "do-block"?
import Data.Listimport Data.List.Splitimport Data.Charimport Data.Maybemain :: IO ()main = donames <- readFile "names.txt"print $ sum $ map (\x -> getPosition names x * getScore x) namesgetPosition :: [String] -> String -> IntgetPosition names x = fromMaybe 0 (elemIndex x $ sortedNamesList names) + 1getScore :: String -> IntgetScore xs = sum $ map (\x -> ord x - 64) xssortedNamesList :: [String] -> [String]sortedNamesList names = sort $ nameList namesnameList :: String -> [String]nameList = split (dropDelims . dropBlanks $ oneOf ",\"")