Re: findall resulting in strange message

From: Fabian Reck <>
Date: Fri, 19 Apr 2013 18:28:08 +0200

> In the meantime, I had already come across the libraries AllSolutions
> and SearchTree, which worked fine for me. I understand that AllSolutions
> uses fixed search strategies, while SearchTree allows you to choose
> different search strategies, including ones you have defined yourself.
> However, it seems that when using the SearchTree library, you always
> have to explicitly construct the search tree first and then turn it into
> a list. Is there also a convenience function that takes a search
> strategy and an expression and gives you an I/O action yielding a list
> of search results? The type of such a function should be something like
> (SearchTree a -> ValueSequence a) -> a -> IO [a] .


there is no such function in the SearchTree module, but we should
definitely add one. It is quite easy to implement the function you are
asking for:

getAllValuesWith :: (SearchTree a -> ValueSequence a) -> a -> IO [a]
getAllValuesWith strategy exp = do
  t <- getSearchTree exp
  return (vsToList (strategy t))


curry mailing list

Received on Fr Apr 19 2013 - 21:55:38 CEST

This archive was generated by hypermail 2.3.0 : Di Nov 28 2023 - 07:15:13 CET