parse :: Text -> Either ParseError Code
parse raw
  | Text.length upper /= size = Left $ WrongLength raw
  | Text.any (`notElem` alphabet) upper = Left $ UnrecognizedCharacters raw
  | otherwise = pure $ Code upper
  where upper = Text.toUpper raw

-- | Set of allowed characters
--
-- NOINLINE - compute once and store as a CAF.
parse :: Text -> Either ParseError Code
parse raw
  | Text.length upper /= size = Left $ WrongLength raw
  | Text.any (`notElem` alphabet) upper = Left $ UnrecognizedCharacters raw
  | otherwise = pure $ Code upper
  where upper = Text.toUpper raw

-- | Set of allowed characters
--
-- NOINLINE - compute once and store as a CAF.
parse raw
  | Text.length upper /= size = Left $ WrongLength raw
  | Text.any (`notElem` alphabet) upper = Left $ UnrecognizedCharacters raw
  | otherwise = pure $ Code upper
  where upper = Text.toUpper raw

-- | Set of allowed characters
--
-- NOINLINE - compute once and store as a CAF.