ace "," Text.empty match) >>= double
      _ -> Nothing
  }

ruleSuffixes :: Rule
ruleSuffixes = Rule
  { name = "suffixes (K,M,G))"
  , pattern =
    [ dimension Numeral
    , regex "(k|m|g)(?=[\\W$€¢£]|$)"
    ]
  , prod = \case
      (Token Numeral nd : Token RegexMatch (GroupMatch (match : _)):_) -> do
        x <- case Text.toLower match of
          "k" -> Just 1e3

ruleCompositeHundredsAndUnits :: Rule
ruleCompositeHundredsAndUnits = Rule
  { name = "integer 100..999"
  , pattern =
    [ oneOf [100,200..900]
    , numberBetween 1 20
    ]
  , prod = \case
      (Token Numeral NumeralData{TNumeral.value = hundreds}:
       Token Numeral NumeralData{TNumeral.value = units}:
       _) -> double $ hundreds + units
      _ -> Nothing
  }
ruleCompositeHundredsAndUnits = Rule
  { name = "integer 100..999"
  , pattern =
    [ oneOf [100,200..900]
    , numberBetween 1 20
    ]
  , prod = \case
      (Token Numeral NumeralData{TNumeral.value = hundreds}:
       Token Numeral NumeralData{TNumeral.value = units}:
       _) -> double $ hundreds + units
      _ -> Nothing
  }