
13 Nov
2019
13 Nov
'19
2:04 p.m.
Hello, Can anyone shed a light on the proper way to write the function below. It looks pretty standard, but it's not clear to me what it is? data Abortable res = Aborted | Executed res deriving Functor -- i.e. Maybe abortableThroughEither :: Abortable (Either a b) -> Either a (Abortable b) abortableThroughEither Aborted = Right Aborted abortableThroughEither (Executed (Left a)) = Left a abortableThroughEither (Executed (Right b)) = Right (Executed b) Thanks! Dimitri -- 2E45 D376 A744 C671 5100 A261 210B 8461 0FB0 CA1F