od = \case
      (token:_) -> Just token
      _ -> Nothing
  }

ruleHalf :: Rule
ruleHalf = Rule
  { name = "half"
  , pattern =
    [ regex "(1|一)?半(半|个|個)?"
    ]
  , prod = \case
      (_:_) -> doubl
ruleNumeral :: Rule
ruleNumeral = Rule
  { name = "<number>个/個"
  , pattern =
    [ dimension Numeral
    , regex "个|個"
    ]
  , prod = \case
      (token:_) -> Just token
      _ -> Nothing
  }
ruleNumeral = Rule
  { name = "<number>个/個"
  , pattern =
    [ dimension Numeral
    , regex "个|個"
    ]
  , prod = \case
      (token:_) -> Just token
      _ -> Nothing
  }