Skip to content

Commit

Permalink
No ppx let for lists
Browse files Browse the repository at this point in the history
  • Loading branch information
drewolson committed Dec 8, 2023
1 parent 3d3d661 commit d3bd495
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/year2023/day07.ml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,10 @@ let hand_type hand =
let rec expand = function
| [] -> [ [] ]
| Jack :: rest ->
let%bind.List c = all_of_card
and h = expand rest in
if equal_card c Jack then [] else [ c :: h ]
| c :: rest ->
let%map.List hand = expand rest in
c :: hand
List.concat_map all_of_card ~f:(function
| Jack -> []
| c -> List.map (expand rest) ~f:(List.cons c))
| c :: rest -> List.map (expand rest) ~f:(List.cons c)
;;

let hand_type' hand =
Expand Down

0 comments on commit d3bd495

Please sign in to comment.