euler-0.1.0.0

Safe HaskellSafe
LanguageHaskell2010

Euler.Problems.Problem22

Synopsis

Documentation

>>> :set -XOverloadedStrings

type InputText = Text Source #

The contents of the input file: a comma-delimited list of quoted strings.

parseNames :: InputText -> [Name] Source #

Parse the input text for this problem.

>>> parseNames "\"Alice\",\"Bob\""
["Alice","Bob"]

unquote :: Text -> Text Source #

>>> unquote "\"Alice\""
"Alice"

answer :: InputText -> Integer Source #

The answer to the problem, given the input text.

>>> answer "\"Bob\",\"Alice\""
68
      A   l    i   c   e           B   o    b
(1 * (1 + 12 + 9 + 3 + 5)) + (2 * (2 + 15 + 2))