Skip to content

Instantly share code, notes, and snippets.

@Rembane
Last active January 2, 2016 18:29
Show Gist options
  • Save Rembane/8343921 to your computer and use it in GitHub Desktop.
Save Rembane/8343921 to your computer and use it in GitHub Desktop.
A prime number generator, for fun!
import qualified Data.Vector as V
steppingPrimeGenerator :: (V.Vector Int, Int) -> (V.Vector Int, Int)
steppingPrimeGenerator (ps, x) | V.null $ V.filter ((==0) . (mod x)) ps = (V.snoc ps x, succ x)
| otherwise = (ps, succ x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment