mirror of
https://github.com/tfausak/witch.git
synced 2024-11-26 09:43:03 +03:00
Improve tryVia
example
This commit is contained in:
parent
2c5c9d69d6
commit
a700237426
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user