<div dir="ltr"><div>Nice! Your second version is much better. It's also clearer than Richards foldr version.<br><br>This also my first introduction to unfold. I will definitely be looking for application of this pattern in the future.<br>
</div><br><div><br><div class="gmail_quote">2008/10/20 Richard O'Keefe <span dir="ltr"><<a href="mailto:ok@cs.otago.ac.nz">ok@cs.otago.ac.nz</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
A version of unfold that I prefer is<br>
<br>
unfold(State, Splitter) -><br>
unfold(State, Splitter, []).<br>
<br>
...<br>
to_proplist(Even_List) -><br>
unfold(Even_List, fun ([Key,Val|Rest]) -> [{Key,Val}|Rest]<br>
; ([]) -> []<br>
end).<br></blockquote></div><br></div></div>