【发布时间】:2016-02-15 16:18:34
【问题描述】:
我有以下代码
let rec function1 element1 element2 = function
| [] -> []
| [a;b;c;d;e;f]::t -> if true then if true then [a]::(function1 element1 element2 t) else (function1 element1 element2 t)
| h :: t -> (function1 element1 element2 t);
,但它不会让我检查语句 1 和语句 2 是否为真
我不断得到
| [a;b;c;d;e;f]::t -> if true then if true then [a]::(function1 element1 element2 t) else (function1 element1 element2 t)
------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
stdin(3,31): error FS0001: This expression was expected to have type
'a list
but here has type
unit
我尝试了很多不同的东西,但似乎我在尝试一些不应该工作的东西。请帮忙
【问题讨论】: