Improve tryVia example

This commit is contained in:
Taylor Fausak 2021-05-01 19:11:56 +00:00 committed by GitHub
parent 2c5c9d69d6
commit a700237426

View File

@ -130,7 +130,11 @@ tryInto = TryCast.tryCast
-- the types in the 'TryCastException.TryCastException' can be tedious.
--
-- > -- Avoid this:
-- > fmap (tryFrom @u) . tryInto @u
-- > case tryInto @u x of
-- > Left _ -> Left ...
-- > Right y -> case tryFrom @u y of
-- > Left _ -> Left ...
-- > Right z -> ...
-- >
-- > -- Prefer this:
-- > tryVia @u