我一直试图让我的程序工作,但我总是得到同样的错误。输入图片描述
这是我的代码
type Nat0 = Int
type Zeichenreihe = String
type Teilzeichenreihe = String
type IstTeilzeichenreihe = Bool
type Zerlegungszeuge = (Zeichenreihe,Zeichenreihe,Zeichenreihe)
type Zerlegungszeugen = [Zerlegungszeuge]
-- Aufgabe A.1
ist_tzr :: Zeichenreihe -> Teilzeichenreihe -> IstTeilzeichenreihe
ist_tzr _ [] = True
ist_tzr [] _ = False
ist_tzr (x:xs) (y:ys)
| x == y = ist_tzr xs ys
| otherwise ist_tzr xs (y:ys)
您在最后一行缺少一个=
符号:
| otherwise ist_tzr xs (y:ys)
应该是:
| otherwise = ist_tzr xs (y:ys)