To phrase the question differently: if we were to remove termination-checking and the guardedness condition on uses of inductive and coinductive data ...
To phrase the question differently: if we were to remove termination-checking and the guardedness condition on uses of inductive and coinductive data ...
This is a corecursive algorithm, because with each iteration it calls itself on data that is greater then what it had before: It is similar to tail ...
Corecursion means calling oneself on data at each iteration that is greater than or equal to what one had before. Corecursion works on codata, which a ...
I've been trying to translate this recursive Haskell implementation of a futumorphism specialized to Lists futuL :: (a -> Maybe (b, ([b], Maybe a) ...
I would like to solve the following dynamic programming problem via corecursion in Prolog. But I am stuck in doing the breadth first search, that I wo ...
I am trying to write a recursive function the evaluate for n I know that in general we need to write it as induction the result for the base case l ...
I'd like to write down some definitions (and prove some lemmas!) about paths in a graph. Let's say that the graph is given implicitly by a relation of ...
Using cata I can fold an AST to a result. With Cofree I can store additional annotations on the AST. How can I take an AST and return an annotated AST ...
I want to write Foldable.toList for a non-empty rose tree using an anamorphism, but it seems impossible to extract the last element: Is it indeed i ...
I wrote a function in Racket to produce something similar to the following fractal. It passes my tests. I changed the code, thinking the belo ...
This (trimmed out) corecursive function definition in Isabelle yields but if I simplify it further to it works. I also tried to use the dec ...
I need help trying to find where to place the print statements in each function (alpha_count and sum_digits) so that they will only print once (at the ...
I'm playing around with the language to start learning and I am puzzled beyond my wits about how a recursive definition works. For example, let's tak ...
I'm trying to create an Observable where each item is produced via an asynchronous task. The next item should be produced via an async call on the res ...
I'm working on a C++ project that requires frequent interaction with a tree structure, which means lots of recursive functions, and I'm looking for wa ...
I’m doing my first experiments with codatatype, but I’m stuck rather early. I started with this definition of a branching, possibly infinite tree: ...
I know in python classes and functions can be created at runtime using type and lambda respectively, but can generators be created at runtime? Examp ...
I've defined the infinite list of infinite lists pathCounts and the infinite list of finite lists pathCounts': Dropping into ghci, if I haven't eva ...
I implemented a broken filter function using an anamorphism from recursion-schemes Hackage library: The function is not a faithful implementation o ...