<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Formatted in this way should be compile:<div><br></div><div><div><div>linerFind :: [Int] -> Int -> MaxSA -> MaxSA --MaxSA is MaximumSubarray</div><div>linerFind xs len ms1@(MaxSA l h m) -- (MaxSA leftPosition rightPosition maxsum)</div><div> | h<len = keepFind ms1 </div><div> | otherwise = ms1</div><div> where keepFind ms'@(MaxSA l' h' m') = let ms2@(MaxSA l2 h2 m2)= find' xs l' (h'+1)</div><div> in if m < m2 </div><div> then linerFind xs len ms2</div><div> else keepFind ms2</div></div></div><div><br></div><div>Bye</div><div><br></div><div>Luca.</div><div><br><div><div>On Sep 9, 2011, at 4:53 PM, anyzhen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><div><div>sorry and please forget the name and what it is meaning for.</div><div>just look at in syntax aspect</div><div><br></div><div>the error : "<font class="Apple-style-span" color="#ff0000">parse error on input `|'</font></div><div><font class="Apple-style-span" color="#ff0000">Failed, modules loaded: none.</font>"</div></div><div><br></div><div><font class="Apple-style-span" color="#0000ff">linerFind </font>:: <font class="Apple-style-span" color="#008000">[Int] -> Int -> MaxSA -> MaxSA </font> --MaxSA is MaximumSubarray</div><div><font class="Apple-style-span" color="#0000ff">linerFind </font>xs len ms1@(MaxSA l h m) -- (MaxSA leftPosition rightPosition maxsum)</div><div> | h<len = keepFind ms1 </div><div> <font class="Apple-style-span" color="#ff00ff">where </font>keepFind ms'@(MaxSA l' h' m')=</div><div> <font class="Apple-style-span" color="#ff00ff">let </font>ms2@(MaxSA l2 h2 m2)= find' xs l' (h'+1) in</div><div> <font class="Apple-style-span" color="#ff00ff">if </font>m < m2 <font class="Apple-style-span" color="#ff00ff">then </font>linerFind xs len ms2</div><div> <font class="Apple-style-span" color="#ff00ff">else </font>keepFind ms2 </div><div> |otherwise = ms1 <font class="Apple-style-span" color="#ff0000">--compiler say error is in this line</font></div></div><div><br></div><div><div><br></div></div>_______________________________________________<br>Beginners mailing list<br><a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>http://www.haskell.org/mailman/listinfo/beginners<br></blockquote></div><br></div></body></html>