Reorder declarations properly.
Don’t reimplement just for different key pattern.
Add some utility functions that should be moved into Prelude, etc.
Actually implement `select`.