pgujjula / apply-merge

Lift a binary, non-decreasing function onto ordered lists and order the output
8 stars 1 forks source link

Add `applyMergeBy` #3

Closed pgujjula closed 4 months ago

pgujjula commented 5 months ago

Add a function

applyMergeBy :: (c -> c -> Ordering) -> (a -> b -> c) -> [a] -> [b] -> [c]

This is a little tricky since the underlying priority queue from pqueue does not support custom comparison functions.

pgujjula commented 4 months ago

https://www.tweag.io/blog/2017-12-21-reflection-tutorial/