more general version of 'custom widgin', we can now match any function, given as argument