Report a paste

Please put a quick comment for the admin.

If it looks like spam, the admin will mark it as spam so that the spam filter picks it up in the future.

If the paste contains something private or offensive, it'll probably just be deleted.

No title

breadth1st : (t -> t -> Bool) -> List (t -> t) -> List t -> List t -> List t
breadth1st _ _ [] best_ts = best_ts
breadth1st is_better_t actions (t_list_top :: t_list_tail) best_ts =
 let
 expanded_t_list : List t = map (\ x : (t -> t) => x t_list_top) actions ++ t_list_tail
 (is_better_bool, is_better_best_ts) : (Bool, List t) = foldr (\ x : t, acc : (Bool, List t) => if is_better_t t_list_top x then (True, snd acc) else (fst acc, x :: snd acc)) (False, []) best_ts
 in if is_better_bool then breadth1st is_better_t actions expanded_t_list is_better_best_ts
 else if any (\ x => is_better_t x t_list_top) best_ts then breadth1st is_better_t actions t_list_tail best_ts
 else breadth1st is_better_t actions expanded_t_list (t_list_top :: best_ts)