Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Hints to define
isoUnMaybe
I'm writing this comment since this is the function I had the most problems defining.
I hope these hints help someone in my situation get into the mindset necessary to solve this on their own.
Hint 1
The resulting function is total, even though it uses a non-total function in the code. It's up to the developer to prove (independently) that the result is total since the type-checker can't verify it on it's own.
Hint 2
Consider the relationship between the value
Just a
that the forward function (:: Maybe a -> Maybe b
) sends toNothing
and the backward function (:: Maybe b -> Maybe a
). Remember that both functions are supposed to form an isomorphism. What kind of relationship would the Null spaces of eitherGiven the fact that the forward (
:: Maybe a -> Maybe b
) and backward (:: Maybe b -> Maybe a
) form an isomorphism, consider the relationship between the value (Just a
) which the forward function sends to Nothing and the backward function.Hint 3
You might want to look into implementing the following special case: