fun can_move 0 0 0 nil = false
| can_move limit_down V 0 a = true
| can_move limit_down V count a = if ((V-limit_down)>hd a) then false else can_move limit_down V (count-1) tl a ;
ちょっとこれは私のコードです V-limit_down の値が int リストの数値よりも低いかどうかを確認したいだけです a.a リストから確認したい引数の数は V/10 です。たとえば、20 V の場合、リストの最初の 2 つの引数を確認します。なぜこのエラーが発生するのですか?
can_move.sml:1.6-3.114 Error:right-hand-side of clause doesn't agree with function result type
[tycon mismatch]
expression: int -> int -> int list -> bool
result type: int -> int -> (Z' list -> 'Z list) -> int list -> bool
in declaration:
can_move (fn arg =) (fn <pat> => <exp>))