Created
February 27, 2014 20:54
-
-
Save YoEight/9259329 to your computer and use it in GitHub Desktop.
My answer to http://codepad.org/McxPLp1l exercise
This file contains hidden or 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
| import Data.Functor.Foldable | |
| divIfMultiple :: Integral a => a -> [a] -> Maybe [a] | |
| divIfMultiple x = cata go | |
| where | |
| go Nil = Just [] | |
| go (Cons a r) | |
| | mod a x == 0 = fmap (div a x:) r | |
| | otherwise = Nothing |
This file contains hidden or 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
| recursion-schemes == 4.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment