Created
March 6, 2012 12:23
-
-
Save mwotton/1986002 to your computer and use it in GitHub Desktop.
name this operator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
whileJust :: Monad m => (b -> m (Maybe b)) -> b -> m b | |
whileJust action seed = action seed >>= maybe (return seed) (whileJust action) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment