<commit_before>module Series (Error(..), largestProduct) where

data Error = InvalidSpan | InvalidDigit Char deriving (Show, Eq)

largestProduct :: Int -> String -> Either Error Integer
largestProduct size digits = error "You need to implement this function."<commit_msg>first test passes<commit_after>module Series (Error(..), largestProduct) where

import Data.Char (digitToInt)

data Error = InvalidSpan | InvalidDigit Char deriving (Show, Eq)

largestProduct :: Int -> String -> Either Error Integer
largestProduct size digits = toInteger . product . map digitToInt <$> Right digits
{'fraction_non_alphanumeric': 0.09385665529010238, 'fraction_numerical': 0.0, 'mean_word_length': 5.311827956989247, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '923810', 'n_tokens_mistral': 157, 'n_tokens_neox': 146, 'n_words': 61}