Skip to content

Instantly share code, notes, and snippets.

@ShinNoNoir
ShinNoNoir / Combinaties.hs
Last active December 10, 2015 16:38 — forked from anonymous/gist:4462276
Variation of an older version... Less computing (still roughly the same amount of time needed), but more memory usage.
module Combinaties where
deleteFromHead :: Eq a => a -> [a] -> [a]
deleteFromHead x [] = []
deleteFromHead x (y:ys)
| x == y = ys
| otherwise = (y:ys)
generate :: Eq a => Int -> [a] -> [a] -> [[a]]