<div dir="ltr"><div>If you are okay with a library, you can use the split library for this.</div><div><br></div><div>stack exec --package split -- ghci</div><div>>chunksOf 2 [1,2,3,4,5,6]<br>[[1,2],[3,4],[5,6]]<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Feb 27, 2021 at 9:08 PM A. Mc. <<a href="mailto:47dragonfyre@gmail.com">47dragonfyre@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hello,<br><div><br></div><div>What is the best way to take:</div><div>[1, 2, 3, 4 ]</div><div> </div><div>And convert it to:</div><div><br></div><div>[ [ [ 1 ], [ 2 ] ], [ [3]. [4] ] ]</div><div><br></div><div>so that each member pair is: </div><div><br></div><div>[ [1], [2] ]</div><div><br></div><div>roughly analogous to a 1x2 vector?</div><div><br></div><div>Thanks in advance and thank you for your time.</div></div>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners</a><br>
</blockquote></div>