each :: (Show a) => Int -> [a] -> [a]each _ [] = []each n (x:xs) = x: each n (drop (n-1) xs) main = print $ each 1 []
Standard input is empty
[1 of 1] Compiling Main ( prog.hs, prog.o ) prog.hs:5:15: Ambiguous type variable `a' in the constraint: `Show a' arising from a use of `each' at prog.hs:5:15-23 Probable fix: add a type signature that fixes these type variable(s)
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!