conditionalHead :: Expander -> TeXParser ConditionalHead
conditionalHead expand =
  ifnum <|> iftrue <|> iffalse
  where
    iftrue =
      (exactToken (ControlSequence "iftrue") <|> aliasFor AliasIfTrue) >> (return IfTrue)

    ifnum = do
      _ <- exactToken (ControlSequence "ifnum")
      left <- number expand
      rel <- relation expand
      right <- number expand
      return $ IfNum left rel right

    iffalse =
      (exactToken (ControlSequence "iffalse") <|> aliasFor AliasIfFalse) >> (return IfFalse)
conditionalHead :: Expander -> TeXParser ConditionalHead
conditionalHead expand =
  ifnum <|> iftrue <|> iffalse
  where
    iftrue =
      (exactToken (ControlSequence "iftrue") <|> aliasFor AliasIfTrue) >> (return IfTrue)

    ifnum = do
      _ <- exactToken (ControlSequence "ifnum")
      left <- number expand
      rel <- relation expand
      right <- number expand
      return $ IfNum left rel right

    iffalse =
      (exactToken (ControlSequence "iffalse") <|> aliasFor AliasIfFalse) >> (return IfFalse)
conditionalHead expand =
  ifnum <|> iftrue <|> iffalse
  where
    iftrue =
      (exactToken (ControlSequence "iftrue") <|> aliasFor AliasIfTrue) >> (return IfTrue)

    ifnum = do
      _ <- exactToken (ControlSequence "ifnum")
      left <- number expand
      rel <- relation expand
      right <- number expand
      return $ IfNum left rel right

    iffalse =
      (exactToken (ControlSequence "iffalse") <|> aliasFor AliasIfFalse) >> (return IfFalse)