(parseIdent >>= \i.if (i == "snd") (pure FieldSnd) empty))))
parseOp1 :: Parser Token Op1
-parseOp1 = trans1 DashToken UnMinus <|>
- trans1 ExclamationToken UnNegation
+parseOp1 = trans1 DashToken UnMinus <|> trans1 ExclamationToken UnNegation
parseBBraces :: (Parser Token a) -> Parser Token a
parseBBraces p = satTok BraceOpenToken *> p <* satTok BraceCloseToken
<* satTok BraceCloseToken
trans2 :: TokenValue (TokenValue -> a) -> Parser Token a
-trans2 t f = satTok t >>= \(_, r).pure (f r)
+trans2 t f = liftM (f o snd) $ satTok t
trans1 :: TokenValue a -> Parser Token a
trans1 t r = trans2 t $ const r