直到大约一个月前,一切都很好......
突然我得到
berkson.github.io/source/blog.hs: 333, 42
• Couldn't match type ‘unordered-containers-0.2.7.1:Data.HashMap.Base.HashMap
text-1.2.2.1:Data.Text.Internal.Text
aeson-0.11.2.0:Data.Aeson.Types.Internal.Value’
with ‘M.Map [Char] [Char]’
Expected type: M.Map [Char] [Char]
Actual type: Metadata
• In the first argument of ‘(M.!)’, namely ‘md’
In the first argument of ‘(++)’, namely ‘(md M.! "author")’
In the second argument of ‘(++)’, namely ‘(md M.! "author") ++ "/"’
从代码:
directorizeDateAndAuthor :: Routes
directorizeDateAndAuthor = metadataRoute $ \md ->
gsubRoute "/[0-9]{4}-[0-9]{2}-[0-9]{2}-" $ \s ->
replaceAll "-" (const "/") s ++ (md M.! "author") ++ "/"
我想知道你是否介意帮我破译它到底在告诉我什么?我知道我的结果存在某种类型的语法错误,但我不明白发生了什么变化以及为什么它不像以前那样编译?
参考:https ://github.com/berkson/berkson.github.io/blob/source/source/blog.hs#L330