你如何在haskell中有多个语句?
这是我正在尝试做的事情:给定一个像[a,b,c,d]这样的列表,返回所有其他元素,所以你得到[a,c].我可以看到解决方案,这是我到目前为止所拥有的:
fact (xs) | length( xs ) `mod` 2 == 1 = head( xs )
| otherwise = fact(tail( xs ))
Run Code Online (Sandbox Code Playgroud)
这在第一次工作正常,但随后退出.我想说的是返回头部,然后调用fact(tail(xs))我该怎么做?