In your code, [x]
, bt_to_list lt
, and bt_to_list rt
all have type 'a list
. However, you are using ::
to append 'a list
with another 'a list
.
The fix is using list concatenation operator @
: (x :: (bt_to_list lt)) @ (bt_to_list rt)
In your code, [x]
, bt_to_list lt
, and bt_to_list rt
all have type 'a list
. However, you are using ::
to append 'a list
with another 'a list
.
The fix is using list concatenation operator @
: (x :: (bt_to_list lt)) @ (bt_to_list rt)