Closed cmeeren closed 6 months ago
Hi @cmeeren - I don't think this is really possible / practical, since Unquote can't really know what Array.forall
does in the general sense. However, there are ways you could rewrite your test to gain greater insight. For example:
let width = 2
test
<@
"a test".Split(" ")
|> Array.map (fun s -> s.Length)
|> Array.forall (fun l -> l <= width)
@>
produces the following output:
"a test".Split(" ", None) |> Array.map (fun s -> s.Length) |> Array.forall (fun l -> l <= width)
[|"a"; "test"|] |> Array.map (fun s -> s.Length) |> Array.forall (fun l -> l <= width)
[|1; 4|] |> Array.forall (fun l -> l <= width)
false
(Not sure this is easily possible. Also, it may apply to all lambdas, not just in the case I describe below.)
Consider this code:
This is displayed as:
With two items in the list, it's no problem, but if the list contains many items, I may have to hunt around a bit to find the failing item.
It would be nice if the evaluation step could display the failing lamba: