<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Take a look at Data.List and the function subsequences.<br>
<a class="moz-txt-link-freetext" href="http://www.haskell.org/ghc/docs/7.0.2/html/libraries/base-4.3.1.0/Data-List.html#v:subsequences">http://www.haskell.org/ghc/docs/7.0.2/html/libraries/base-4.3.1.0/Data-List.html#v:subsequences</a><br>
<br>
The only thing you'll need to figure out after that is how to
transform all of those strings to a list data type.<br>
<br>
I hope this helps,<br>
Bryce<br>
<br>
<br>
On 04/26/2011 11:10 AM, I. J. Kennedy wrote:
<blockquote
cite="mid:BANLkTi=8FpOFUHhKu13Y6=QOVpFjbwudfQ@mail.gmail.com"
type="cite"><font face="arial,helvetica,sans-serif">I'm looking
for a function [a] -> [[[a]]] that will partition a list
into non-empty pieces in all possible ways.</font>
<div>
<div>
<font face="arial,helvetica,sans-serif">For example</font></div>
<div><span class="Apple-style-span" style="font-family:
arial,helvetica,sans-serif;">f [1,2,3,4] =
[[[1],[2],[3],[4]], [[1],[2],[3,4]], [[1],[2,3],[4]],
[[1],[2,3,4]], [[1,2],[3],[4]], [[1,2],[3,4]],
[[1,2,3],[4]], [[1,2,3,4]]]</span></div>
<div><font face="arial,helvetica,sans-serif">Perhaps this is a
well-known function to experts, but not to me. Hoogle
doesn't seem to have anything with this signature.</font></div>
<div><font face="arial,helvetica,sans-serif">Thanks,</font></div>
<div><font class="Apple-style-span" face="arial, helvetica,
sans-serif">Jack</font></div>
</div>
<div><font class="Apple-style-span" face="arial, helvetica,
sans-serif"><br>
</font></div>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Beginners mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Beginners@haskell.org">Beginners@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://www.haskell.org/mailman/listinfo/beginners">http://www.haskell.org/mailman/listinfo/beginners</a>
</pre>
</blockquote>
<br>
</body>
</html>