euler-0.1.0.0
Euler.Problems.Problem22
>>> :set -XOverloadedStrings
>>>
: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"]
parseNames "\"Alice\",\"Bob\""
unquote :: Text -> Text Source #
>>> unquote "\"Alice\"" "Alice"
unquote "\"Alice\""
answer :: InputText -> Integer Source #
The answer to the problem, given the input text.
>>> answer "\"Bob\",\"Alice\"" 68
answer "\"Bob\",\"Alice\""
A l i c e B o b (1 * (1 + 12 + 9 + 3 + 5)) + (2 * (2 + 15 + 2))