the list is:
l = ["1","kg","g"]
I found this method but it didn't work:
map (convert) l
convert [x, "kg", "g"] = (read x :: Integer) *1000
I got the following error:
parse error on input `='
Perhaps you need a 'let' in a 'do' block?
e.g. 'let x = 5' instead of 'x = 5'
|
17 | convert [x, "kg", "g"] = (read x :: Integer) *1000
| ^ ^
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…