<div dir="ltr"><div><div><div>Roelof,<br><br></div>You defined isValid function in the upper-scope first, and then you defined a symbol (variable) that re-wrote that name to something different (string "Geldige string"). That's why you get an error saying it doesn't expect arguments.<br><br></div>My suggestion is to rename second isValid.<br><br></div>Good luck.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 23, 2015 at 4:50 PM, Roelof Wobben <span dir="ltr"><<a href="mailto:r.wobben@home.nl" target="_blank">r.wobben@home.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Chaddaï Fouché schreef op 23-2-2015 om
13:20:<br>
</div><span class="">
<blockquote type="cite">
<div dir="ltr">
<div>Note that Roelof is doing the CIS 194 Homework <a href="http://www.seas.upenn.edu/%7Ecis194/fall14/hw/03-ADTs.pdf" target="_blank">http://www.seas.upenn.edu/~cis194/fall14/hw/03-ADTs.pdf</a>
(the older version of fall2014, not the one currently
running). This is much clearer than Roelof's description, and
gives among other information an algebraic datatype to
represent log messages.<br>
<br>
<br>
-- <br>
</div>
Jedaï<br>
</div>
</blockquote>
<br></span>
Correct and Im trying to do exercise 1 of Week 2,<br>
<br>
I have tried this solution : <br>
<br>
-- | Main entry point to the application.<br>
{-# OPTIONS_GHC -Wall #-}<br>
<br>
module LogAnalysis where<br>
<br>
import Log;<br>
import Data.Char (isLetter, isDigit) <br>
<br>
isValid :: [Char] -> Bool <br>
isValid s = go (words s)<br>
where<br>
go ([a]:b:_) = isLetter a && all isDigit b<br>
go _ = False <br>
<br>
parseMessage :: [Char] -> [Char]<br>
parseMessage s = isValid s <br>
where <br>
isValid = "Geldige string"<br>
_ = "Ongeldige string"<br>
<br>
-- | The main entry point.<br>
main :: IO ()<br>
main = do<br>
putStrLn $ parseMessage "I 4764 He trusts to you to set them
free," <br>
<br>
<br>
but I see this error message : <br>
<br>
<div>src/LogAnalysis.hs@16:18-16:27 </div>
<div><span>Couldn't match expected type
‘[Char] -> [Char]’ with actual type </span>
<div style="font-size:14px">[<span>Char</span>]</div>
<span>
The function </span>
<div style="font-size:14px"><span>isValid</span></div>
<span> is applied to one argument,
but its type </span>
<div style="font-size:14px">[<span>Char</span>]</div>
<span> has none</span><span title="Click to show/hide extra
information"> …</span><span style="display:inline">
In the expression: isValid s
In an equation for ‘parseMessage’: parseMessage s = isValid s
where isValid = "Geldige string" _ = "Ongeldige string"<br>
<br>
<br>
</span></div>
<br>
</div>
<br>_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br></div>