I need to implement a split function in haskell where user gives the as a example input
splitx [1,2,3,4,5,6] 3
should output -> [1,2,3]
splitx::[Int]->Int->[Int]
splitx [] 0 = []
splitx (x:xs) n = x: splitx xs (n-1)
i wrote the following function but it gives a error
Non-exhaustive patterns in function Main.splitx
just tell me where am i wrong ?