如何在 Haskell 中删除列表的一部分?这是我到目前为止所做的。请告诉我可以进行哪些更改:
import Data.List
import Data.List.Split
removePrefix :: Eq t => [t] -> [t] -> Maybe [t]
removePrefix [] [] = Nothing
removePrefix ts [] = Just ts
removePrefix (t:ts) (y:ys) =
if inTnFixOf (y:ys) (t:ts) == True
then SrtipPrefix (y:ys) (t:ts)
else Just [(x:xs)]
示例:输入“toyboat”输出“boat”