此函数的类型为
function :: Num a => ([Char],a) -> ([Char],a)
(".'*",0)
'.'
或
'*'
和更新
a
function ([], a) = ([], a)
function ((x:xs), a)
| x == '.' = ('-':xs, a+200)
| x =='*' = ('-':xs, a+400)
| otherwise = function(xs, a) --how do I put the unchanged x before xs without processing it?