alma hatası Prelude.read: Ben Haskell çok yeniyim hiçbir ayrıştırma
i öğe detayları için kod yazdım ve her öğe için detay arayın.
type Code = Int
type Name = String
type Database = (Code,Name)
textfile::IO()
textfile = appendFile "base.txt" (show[(110,"B")])
arama
fun::IO()
fun=do putStrLn"Please enter the code of the product"
x<-getLine
let y = read x :: Int
show1 y
textshow::IO [Database]
textshow= do x<-readFile "base.txt"
let y=read x::[Database]
return y
show1::Code->IO()
show1 cd= do o<-textshow
let d=[(x,y)|(x,y)<-o,cd==x]
putStr(show d)
için kod ama, sorun ben başka veri ekleme, eğer ben öğeyi aramak için çalışıyorum o zaman hata Prelude.read: no parse
gösteren, tek veriler için iyi çalışıyor ise . Yardımı takdir edilecektir!
Sorunu tetikleyen örnek bir giriş ekleyebilir misiniz? – ibid
Örnek i/o snap yükledim, lütfen bir göz atın. –
Ayrıca, metin gösterisi ve show1'de girinti sorunları var. Ama bence bu problemi gösteriyor. Kısaca cevap vermek. – ibid