The following code I wrote in haskell
```hs
factorial(1)=1
factorial(n)=n*(n-1)*factorial(n-2)
```
gives me an error when I try to run it. Is there anything I did wrong?
Yes, there is an issue with the recursive definition of the `factorial` function in your Haskell code. Specifically, the line `factorial(n)=n*(n-1)*factorial(n-2)` is incorrect, as it assumes that `n` is always odd, which is not the case for most values of `n`.

To define the factorial function correctly, you can use the following code:

```
factorial 0 = 1
factorial n = n * factorial (n - 1)
```

This code defines the factorial function using a recursive approach that handles the base case for `n=0` and then recursively computes the factorial for `n-1` until it reaches the base case. 

Note that in Haskell, function definitions do not require parentheses around the argument list, so you can define the function as `factorial 0 = 1` instead of `factorial(0)=1`. Also, make sure to use spaces between function names, arguments, and operators, as this is required in Haskell syntax.

With these changes, your `factorial` function should work correctly in Haskell.
thanks! it works now
You're welcome! Let me know if you have any questions about your Haskell code!