Hey there,
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:
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!
Hey there,
Great work again. =) Just wanted to say it'd be sweet if the
slicetypewriter could support codegen'ing aPriorityQueueimplementation too, via theHeapinterface:https://golang.org/pkg/container/heap/ (see
PriorityQueueexample)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!