layout problem

G?????? ??sµ?d?? gkosmidis@epsilon7.gr
Thu, 19 Sep 2002 17:33:24 +0300


at least i passed that line!
unfortunatelly i stack again :(
This is the error this time.
What can i say.I cannot understand the error the compiler returns.it is not
much help.

ERROR "c:\1.hs":69 - Syntax error in expression (unexpected `<-')
module_Main_where
import_IO
import_System
import_List
import_Maybe
import_Char
import_Numeric

type_Word=String
type_WordCount=Int
type_WordTup=(word,wordCount)
type_WordList=[WordTup]

main=do_args<-getArgs
________textLines<-getText
________switchArgs_args_textLines
________where
________switchArgs_args_textLines
  ________|(isMemberOf_"-f"_args)_&&_(isMemberOf_"-i"_args)
_________________________=printFreq(sortWordCount(parseLcLine_textLines))
________________________|(isMemberOf_"-f"_args)
_________________________=printFreq(sortWordCount_(parseLine_textLines))
________________________|(isMemberOf_"-i"_args)
_________________________=printFreq(sortWordCount_(parseLcLine_textLines))
________________________|otherwise
_________________________=printFreq(sortName_(parseLine_textLines))
________getText::IO_String
________getText=do_c<-getChar
___________________e<-isEOF
___________________if_(e)
 _______________then_return_""_else
_______________________(do_nc<-getText
___________________________return_(:nc))
________parseLine::String->Wordlist
________parseLine_line
__________________|(line/="")&&(isWantedChar_(headline))
___________________=fillWordList_w(parseLine_newLine)
__________________|(line/="")&&(not(isWantedChar_(headline)))
___________________=parseLine(tail_line)

________isMemberOf::String->[String]->Bool
________isMemberOf_arg_args_
___________________=[]/=[a|a<-args,a==arg]

________printFreq::WordList->IO()
________printFreq_wl=do_sequence_(map_putWordStat_wl)
_________________________________where_
______________________________________putWordStat::(Word,WordCount)->IO()
______________________________________putWordStat(w,wc)=do_putStr_w
___________________________________________________________putSpc_(20_(lengt
h_w)_(length(show_wc)))
___________________________________________________________putStr_(show_wc)
___________________________________________________________putSpc_8
___________________________________________________________putStr_(showFFloa
t_(Just_2)_(fromIntegral_(wc)_*_100.0/fromIntegral_(wLength))"")
___________________________________________________________putChar_'%'
___________________________________________________________putChar_'\n'
___________________________________________________________return(wlLength-c
ountWords_wl)
________putSpc::Int->IO()
________putSpc_n
_______________|(n>1)_=_do_putChar_'_'
___________________________putSpc_(n-1)
___________________________return()
_______________|otherwise_=_putChar_'_'

________countWords::Wordlist->Int
________countWords_[]
____________________countWords_((w,wc):wl)=wc+countWords_wl
________sortName::WordList->WordList
________sortName_[]_=_[]_
________sortName_(wn:ws)=sortName_[(w,wc)_(w,wc)_<-_ws,not_(isGreater_(w,wc)
_wc)]
_________________________++[wn]++sortName[(w,wc)|(w,wc)<-ws,_isGreater_(w,wc
)_wn]
__________________where
__________________isGreater_(wl,wcl)_(w2,wc2)
_____________________________|ord(head(wl))-ord(head(x2))>0=True
_____________________________|ord(head(wl))-ord(head(x2))<0=False
_____________________________|length_wl>l_&&_length_w2>l
______________________________=isGreater(tail(wl),wcl)_(tail(w2,wc2)
_____________________________|otherwise_=_[]
_____________________________where
_____________________________w=parseWord_line
_____________________________newline=drop_(length_w)_line
________parseLcLine::String->WordList
________parseLcLine_line
____________________|(line/="")_&&_(isWantedChar_(head_line))=fillWordList_w
_(parseLcLine_newline)
____________________|(line/="")_&&_(not_(isWantedChar_(head_line)))=parseLcL
ine_(tail_line)
____________________|otherwise_=_[]
____________________where
____________________w=map_toLower_(parseWord_line)
____________________newline=drop_(lenfth_w)_line
________parseWord::Word->Word
________parseWord_w
__________________|(w/="")_&&_(isWantedChar_(head_w))=(head_w):_parseWord_(t
ail_w))
__________________|otherwise_=_""

________isWantedChar::Char->Bool
________isWantedChar_c
_____________________|_(c=='a'||_c=='b'||_c=='c'||_c=='d'||_c=='e'||_c=='f'
||_c=='g'||_c=='h'||_c=='i'||__c=='j'||_c=='k'||_c=='l'||_c=='m'||_c=='n'
||_c=='o'||_c=='p'||_c=='q'||_c=='r'||_c=='s'||_c=='t'||_c=='u'||_c=='v'
||_c=='w'||_c=='x'||_c=='y'||_c=='z'||c=='A'||_c=='B'||_c=='C'||_c=='D'
||_c=='E'||_c=='F'||_c=='G'||_c=='H'||_c=='I'||__c=='J'||_c=='K'||_c=='L'
||_c=='M'||_c=='N'||_c=='O'||_c=='P'||_c=='Q'||_c=='R'||_c=='S'||_c=='T'
||_c=='U'||_c=='V'||_c=='W'||_c=='X'||_c=='Y'||_c=='Z'||_=_True)
_____________________|otherwise_=_False
_______fillWordList::Word->WordList->WordList
_______fillWordList_w_wordlistl
____________________|cWord/=_[]_=cWord++[wordl,wordCountl)|(wordl,wordCountl
<-wordListl,wordl/=w]
____________________|otherwise_=_(w,l):wordListl
____________________where
____________________cWord=[(wordl,(wordCountl-l))_|_(wordl,wordCountl)<-word
Listl,wordl==w]
__________________________________________________|length_w1>1_&&_length_w2=
=1=True
__________________________________________________|otherwise_=_False
________sortWordCount::WordList->WordList
________sortWordCount_[]_=_[]
________sortWordCount_((wn,wcn):ws=sortWordCount_[(w,wc|cw,wc)<-ws,ws<=wvn++
_
_______________________[(wn,wcn)]++sortWordCount_[(cw,wc)|(w,wc)<-ws,wcs,wcn
]