switch package:data-memocombinators

switch p a b uses the memo table a whenever p gives true and the memo table b whenever p gives false.