test::Int->(Int-> Char)->Char
test n f = f(n)
DD::Int->Char
DD a | a==1 = '1'
测试这是一个高阶函数,当前返回一个char值,我需要返回一个String
as test::Int->(Int-> Char)->String
我改为功能体
test::Int->(Int-> Char)->String
test n f = map f(n)
错误
Type error in application
*** Expression : map f n
*** Term : n
*** Type : Int
*** Does not match : [a]
如何将此函数应用于带有 map 的字符串?我哪里出错了?