https://wiki.haskell.org/api.php?action=feedcontributions&user=Brian&feedformat=atomHaskellWiki - User contributions [en]2024-03-28T17:07:37ZUser contributionsMediaWiki 1.35.5https://wiki.haskell.org/index.php?title=Talk:99_questions/1_to_10&diff=22045Talk:99 questions/1 to 102008-07-30T17:33:01Z<p>Brian: </p>
<hr />
<div>==Bad format==<br />
<br />
The format of this page is awful. I'm collecting the problem descriptions, but having to be very careful not to look at the solutions.<br />
<br />
The function signature and description of what it is to do should be given. The solutions should be on some separate page.<br />
<br />
==Does the problem 1 example need correction?==<br />
<br />
The problem refers us to <hask>last</hask> as a <hask>Prelude</hask> function providing the same functionality. However, <hask>last</hask> has type <hask>[a] -> a</hask> which differs from the Lisp example's type <hask>[a] -> [a]</hask>. Should we revise the example or should we rephrase the reference to <hask>last</hask> to highlight the difference?<br />
<br />
[[User:Chrycheng|Chrycheng]] 12:02, 12 September 2007 (UTC)<br />
<br />
I think the answer to problem 6 is kind of "cheating". I think something like this would be a nice alternate solutions:<br />
<br />
<haskell><br />
isPalindrome :: Eq (a) => [a] -> Bool<br />
isPalindrome [] = True<br />
isPalindrome [x] = True<br />
isPalindrome (x:xs) = x == last xs && isPalindrome (init xs)<br />
</haskell><br />
<br />
[[User:Michael|Michael]] 16:40, 17 January 2008 (UTC)</div>Brian