Mapping over Either's Left

前端 未结 4 1681
慢半拍i
慢半拍i 2021-02-02 11:48

Somewhere in my app I receive an Either ParserError MyParseResult from Parsec. Downstream this result gets some other parsing done over using other libs. During tha

4条回答
  •  温柔的废话
    2021-02-02 11:48

    Another simple option is mapLeft in Data.Either.Combinators:

    mapLeft :: (a -> c) -> Either a b -> Either c b
    

提交回复
热议问题