unfold Questions
9
Solved
In my .vimrc I've put set foldmethod=syntax to enable folding of methods etc. However, I don't like the default that everytime I open a file, the whole thing is folded. Is there a way to enable fol...
7
I'm using the dump function of the twig.
But it shows the data "folded", like in here:
When I click the arrow, I may reveal the data by unfolding it, like in here:
Question:
Is there an...
2
The example given in the documentation of unfoldr :: (b -> Maybe (a, b)) -> b -> [a]:
unfoldr (\b -> if b == 0 then Nothing else Just (b, b-1)) 10
can easily be written with a redund...
1
Solved
Over on Code Review, I answered a question about a naive Haskell fizzbuzz solution by suggesting an implementation that iterates forward, avoiding the quadratic cost of the increasing number of pri...
Lennielenno asked 11/9, 2015 at 10:38
1
Solved
I've been thinking in how to implement the equivalent of unfold for the following type:
data Tree a = Node (Tree a) (Tree a) | Leaf a | Nil
It was not immediately obvious since the standard unfo...
Dissolute asked 21/2, 2015 at 23:6
1
Data.Tree includes unfoldTreeM_BF and unfoldForestM_BF functions to construct trees breadth-first using the results of monadic actions. The tree unfolder can be written easily using the forest unfo...
2
Solved
Here is a recursive function all_zero that checks whether all members of a list of natural numbers are zero:
Require Import Lists.List.
Require Import Basics.
Fixpoint all_zero ( l : list nat ) :...
1
© 2022 - 2024 — McMap. All rights reserved.