Programming Infinite Structures Using Copatterns