You might start with looking into <a href="http://haskell.org/ghc/docs/latest/html/libraries/base-4.2.0.0/Prelude.html#v:span">span</a>.<br><br><span style="font-family: courier new,monospace;">span :: (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])</span><br>
<br><br>For example try these,<br><br style="font-family: courier new,monospace;"><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">span (&#39;a&#39;==) &quot;abcd&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">span (&#39;a&#39;==) &quot;aaabcd&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">span (&#39;c&#39;==) &quot;abcd&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">span (&#39;c&#39;/=) &quot;abcd&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">span (&#39;c&#39;/=) &quot;abcdcdcd&quot;</span><br>
</div><br><br><br><div class="gmail_quote">On 16 March 2010 17:08, Roger Whittaker <span dir="ltr">&lt;<a href="mailto:roger@disruptive.org.uk">roger@disruptive.org.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I found some exam papers linked from this page:<br>
<a href="http://www.cs.chalmers.se/Cs/Grundutb/Kurser/d1pt/d1pta/external.html" target="_blank">http://www.cs.chalmers.se/Cs/Grundutb/Kurser/d1pt/d1pta/external.html</a><br>
<br>
And I have been trying some questions from them.<br>
<br>
I&#39;m currently baffled by question 2(b) on this one:<br>
<a href="http://www.cs.chalmers.se/Cs/Grundutb/Kurser/d1pt/d1pta/tenta2000-04.ps" target="_blank">http://www.cs.chalmers.se/Cs/Grundutb/Kurser/d1pt/d1pta/tenta2000-04.ps</a><br>
<br>
  A word is a sequence of alphabetic characters, which you can recognise<br>
  using the standard function<br>
<br>
  isAlpha :: Char -&gt; Bool<br>
<br>
  Using span, define a function words :: String -&gt; [String] which<br>
  finds a list of the words occurring in a string. For example,<br>
<br>
  words &quot;Now is the winter of our discontent!&quot;<br>
    == [&quot;Now&quot;,&quot;is&quot;,&quot;the&quot;,&quot;winter&quot;,&quot;of&quot;,&quot;our&quot;,&quot;discontent&quot;]<br>
<br>
  words &quot;2+3&quot; == []<br>
<br>
  words &quot;1 by 1&quot; == [&quot;by&quot;]<br>
<br>
Can anyone give me a clue how to start?<br>
<br>
<br>
<br>
<br>
--<br>
========================<br>
<font color="#888888">Roger Whittaker<br>
<a href="mailto:roger@disruptive.org.uk">roger@disruptive.org.uk</a><br>
<a href="http://disruptive.org.uk" target="_blank">http://disruptive.org.uk</a><br>
========================<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Ozgur Akgun<br>