Taillefer, Troy (EXP) wrote:
Hi there
1. First of all never forget your base case for exiting your recursion
2. you need to break up the problem like so
import Char
-- get the first word
word :: String -> String
word [] = []
word ( x : x1 : xs )
| isSpace x = []
| isSpace x1 =
hould it work since I am curious now.
--
View this message in context:
http://www.nabble.com/Hi-I-need-help-for-very-simple-question%21-tf3334486.html#a9272506
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
___
Haskell-Cafe mailin
On Fri, Mar 02, 2007 at 08:22:46AM -0800, iliali16 wrote:
> suggestions. Also I don't know how to produce a base case for my recursion.
>
> import Char
>
> intoWords ::String -> [String]
>
> intoWords (x:xs)
> |isSpace x = intoWords xs
> |otherwise = xs
He. You got the type signat
iliali16
Sent: March 2, 2007 11:23 AM
To: haskell-cafe@haskell.org
Subject: [Haskell-cafe] Hi I need help for very simple question!
Hi Haskell People,
I have problem implementing one function. I think my idea is write but I
have minor mistakes which I cannot get right since I progrem Haskell
from ver
hould it work since I am curious now.
--
View this message in context:
http://www.nabble.com/Hi-I-need-help-for-very-simple-question%21-tf3334486.html#a9272506
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
___
Haskell-Cafe
On style, yes. A concrete example of what I asked before.
The following doesn't type check for obvious reasons.
In your opinion what is the most elegant way to fix it?
Like I said, I'm starting to feel like defining my own operators is the way to
go. On the other hand, this kind of situation se