Great work again. =) Just wanted to say it'd be sweet if the slice typewriter could support codegen'ing a PriorityQueue implementation too, via the Heap interface:
Although if it's helpful, what I'm really looking to do is something like a "top N by \<func>". An ideal implementation would use a heap/priority queue with capacity N, so discard anything ranked lower than N as I iterate over the slice and add things to this heap/priority queue.
Hey there,
Great work again. =) Just wanted to say it'd be sweet if the
slice
typewriter could support codegen'ing aPriorityQueue
implementation too, via theHeap
interface:https://golang.org/pkg/container/heap/ (see
PriorityQueue
example)Although if it's helpful, what I'm really looking to do is something like a "top N by \<func>". An ideal implementation would use a heap/priority queue with capacity N, so discard anything ranked lower than N as I iterate over the slice and add things to this heap/priority queue.
Thanks for the consideration!