Created
February 17, 2018 20:13
-
-
Save Axect/1df51d50edfb330d3bd475aa18245b43 to your computer and use it in GitHub Desktop.
lazy4
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
factors :: Integral a => a -> [a] -> [a] | |
factors 1 _ = [] | |
factors m (p:ps) | m < p*p = [m] | |
| r==0 = p:factors q (p:ps) | |
| otherwise = factors m ps | |
where (q,r) = quotRem m p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment