Ich frage mich, was (answers entry)
in totnChars entry = myLoop (answers entry)
ist. Bedeutet dies, dass der Eintrag vom Typ answers
sein muss? Aber ist nicht entry
vom Typ Entryt
?Eine Haskell-Funktion verstehen
type Question = [Char]
type Answer = [Char]
type Music = [Char]
data Entryt = MyEntry {
questions :: [Question],
answers :: [Answer],
music :: Music,
time :: Float
} deriving (Show, Eq)
totnChars :: Entryt -> Int
totnChars entry = myLoop (answers entry)
myLoop :: [Answer] -> Int
myLoop [] = 0
myLoop (x:rest) = (nChars x 0) + (myLoop rest)
Der Typ von 'Antworten' ist' Enquiryt -> [Answer] '. – pyon
Was gewinnen wir, indem wir explizit schreiben (Antworteintrag)? – DoubleOseven