5 kyu
Join until impossible
Description:
We have join
:
join :: (Monad m) => m (m a) -> m a
join (Just (Just x)) = Just x
join _ = Nothing
So join (Just (Just 1))
evaluates to Just 1
, unwrapping extra layers.
We may want to join arbitrarily many nested Maybe
s, until the type is Maybe a
, where a
is not Maybe something
.
Implement this function, jojo
( join-join-join-..-join so jojo ).
Inspired by @ice1000
's Agda kata, of the same name but different intent.
Fundamentals
Similar Kata:
Stats:
Created | Mar 20, 2021 |
Published | Mar 20, 2021 |
Warriors Trained | 151 |
Total Skips | 11 |
Total Code Submissions | 264 |
Total Times Completed | 35 |
Haskell Completions | 35 |
Total Stars | 7 |
% of votes with a positive feedback rating | 96% of 12 |
Total "Very Satisfied" Votes | 11 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 4 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 6 kyu |