tracks/fsharp/exercises/all-your-base/Example.fs in trackler-2.2.1.44 vs tracks/fsharp/exercises/all-your-base/Example.fs in trackler-2.2.1.45
- old
+ new
@@ -14,10 +14,13 @@
| [] -> Some acc
| digit::rest ->
if digit < 0 then None else
if digit >= b then None else
loop (acc * b + digit) rest
- if nums = [] then None else loop 0 nums
+
+ match nums with
+ | [] | 0::_ -> None
+ | _ -> loop 0 nums
let rebase inB inDigits outB =
if inB < 2 || outB < 2 then None else
match fromBase inB inDigits with
| None -> None
\ No newline at end of file