0
data Film = Film String String Int [String] deriving (Eq, Ord, Show, Read)
--that's my custom data type, (Film *filmname, director, year of release, fans)
addFilm :: Film -> [Film] -> [Film]
addFilm newFilm filmList = filmList ++ [newFilm]
--this is for adding a new film to the list, but without the fans string array
该模块正在加载到WinGHCi没有错误,但我不知道如何代替filmList。作为filmList参数的值,输入什么?
---
<interactive>:63:30:
Couldn't match type `Char' with `Film'
Expected type: [Film]
Actual type: [Char]
In the second argument of `addFilm', namely `"Jordan Vogt-Roberts"'
In the expression:
addFilm "Kong: Skull Island" "Jordan Vogt-Roberts" 2017
In an equation for `it':
it = addFilm "Kong: Skull Island" "Jordan Vogt-Roberts" 2017
*Main> addFilm "Kong: Skull Island" "Jordan Vogt-Roberts" 2017 filmList
<interactive>:64:57: Not in scope: `filmList' --- that's what I input.
我想我的意思是空串的粉丝,而不是“没有它”。对不起,谢谢。 – Saad