SML初心者です。簡単なことですが、何時間もかかりましたが、解決できません。
文字列のリストを取得し、すべての文字列とリストを反転する必要があります。メインの外で複数の関数を定義せずにすべてを行います。例 ["stack","overflow","nice"] は ["ecin","wolfrevo","kcats"] を返します
fun oppositelist(l)=foldl (op::) nil (map ((fn(x)=>(implode o rev o explode)(x)), l));
エラーメッセージは次のとおりです。
Error: operator and operand don't agree [tycon mismatch]
operator domain: 'Z -> 'Y
operand: (string -> string) * 'X
in expression:
map ((fn x => <exp> <exp>),l)
方法が間違っている場合は、すべてを解決しないでください。ほのめかす。宿題の質問です。
ありがとうございました。