Err error succeeds with the error, Ok fails.
import Morph
import Char.Morph
Err 'Y'
|> Morph.toNarrow
(Char.Morph.only 'Y'
|> Morph.over Result.Morph.toErr
)
--> Ok ()
Ok [ "Bye", "!" ]
|> Morph.toNarrow Result.Morph.toErr
--> Err (Morph.DeadEnd "ok")
Ok successsucceeds with thesuccess,Err errorfails with theerror.If your error type is not a
String, you will need|> Morph.errorMap(Morph.deadEndMap ..your error to String..)to make dead end types unify.