Currently the composition methods will modify the query instead of returning a new query. For a library such as this where saving space isn't really a problem but side-effects definitely could be, function is probably the way to go.
eg.
Becomes
query = query.WithFilter(filter)