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 Maybes, 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

Stats:

CreatedMar 20, 2021
PublishedMar 20, 2021
Warriors Trained151
Total Skips11
Total Code Submissions264
Total Times Completed35
Haskell Completions35
Total Stars7
% of votes with a positive feedback rating96% of 12
Total "Very Satisfied" Votes11
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes0
Total Rank Assessments4
Average Assessed Rank
5 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • JohanWiltink Avatar
  • Kacarott Avatar
Ad