Haskell help!
Weix, Rachel Lynn
weixrl@uwec.edu
Wed, 26 Mar 2003 16:32:41 -0600
This is a multi-part message in MIME format.
------_=_NextPart_001_01C2F3E7.9CD6E0DC
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
P.S. The example given is for the set of sequences/strings =
(The,Masters)
-----Original Message-----=20
From: Weix, Rachel Lynn=20
Sent: Wed 3/26/2003 4:30 PM=20
To: coeus@gmx.de=20
Cc: haskell@haskell.org=20
Subject: RE: Haskell help!
=09
=09
Currently I'm having problems with type checking due to Haskell being a =
strongly typed language. In order to return all optimal solutions, my =
professor suggested I create a list of tuples if they all have the same =
score, as indicated in my new maxSeq method (see attachment). However, =
this means that the maxSeq method would return type [[(Char,Char)]]. =
Since maxSeq and getSeq must return the same type, I end up changing all =
my signatures and end up with lots of problems. In my caseX methods, I =
can't append [(Char)] to [[(Char,Char)]], and it also messes up trying =
to get my score of each tuple, etc. I've been trying to solve the =
problem in Scheme first but even then I'm having problems, and Scheme is =
only loosely typed. Any suggestions? The format should be something =
like the following (partial example):
=20
[ [(-,M)] [(T,a)(h,s)(-,t)(e,e)(-,r)(-,s)] =
[(-,s)(h,t)(e,e)(-,r)(-,s)]]].=20
=20
Once I get back my list, I need to pair everything up in order to =
return a list of optimal solutions. Taking the previous example, it =
would be the following when paired up correctly:
=20
[ [(-,M)(T,a)(h,s)(-,t)(e,e)(-,r)(-,s)], =
[(-,M)(T,a)(-,s)(h,t)(e,e)(-,r)(-,s)] ]=20
=20
From there, I find which sequence has the maximum score. I then walk =
through the list again, making a list of all the sequences that have =
that score. These two steps seem fairly trivial, it's all the above =
stuff which I'm struggling on.
=20
Rachel
=20
-----Original Message-----=20
From: Marc Ziegert [mailto:coeus@gmx.de]=20
Sent: Tue 3/25/2003 3:13 PM=20
To: Weix, Rachel Lynn=20
Cc:=20
Subject: Re: Haskell help!
=09
=09
maxSeq had one mistake: || instead of &&
=09
i will think about the problem itself, before rewriting all.
=09
this is the file a little bit more in haskell style.
=09
=09
=09
Am Dienstag, 25. M=E4rz 2003 20:16 schrieben Sie:
> I found my two mistakes, plus I fixed the method my Professor said =
was
> incorrect. Now I just have to be able to find ALL optimal =
solutions,
> instead of just one. Hooray!
>
> Rachel
=09
------_=_NextPart_001_01C2F3E7.9CD6E0DC
Content-Type: text/html;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dwindows-1252">=0A=
=0A=
=0A=
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">=0A=
<HTML>=0A=
<HEAD>=0A=
=0A=
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.6249.1">=0A=
<TITLE>Re: Haskell help!</TITLE>=0A=
</HEAD>=0A=
<BODY dir=3Dltr>=0A=
<DIV>P.S. The example given is for the set of sequences/strings =0A=
(The,Masters)</DIV>=0A=
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">=0A=
<DIV><FONT size=3D2>-----Original Message----- <BR><B>From:</B> Weix, =
Rachel =0A=
Lynn <BR><B>Sent:</B> Wed 3/26/2003 4:30 PM <BR><B>To:</B> =
coeus@gmx.de =0A=
<BR><B>Cc:</B> haskell@haskell.org <BR><B>Subject:</B> RE: Haskell =0A=
help!<BR><BR></FONT></DIV>=0A=
<DIV>Currently I'm having problems with type checking due to Haskell =
being a =0A=
strongly typed language. In order to return all optimal =
solutions, my =0A=
professor suggested I create a list of tuples if they all have the =
same score, =0A=
as indicated in my new maxSeq method (see attachment). However, =
this =0A=
means that the maxSeq method would return type =
[[(Char,Char)]]. =0A=
Since maxSeq and getSeq must return the same type, I end up changing =
all my =0A=
signatures and end up with lots of problems. In my caseX =
methods, I =0A=
can't append [(Char)] to [[(Char,Char)]], and it also messes up trying =
to get =0A=
my score of each tuple, etc. I've been trying to solve the =
problem in =0A=
Scheme first but even then I'm having problems, and Scheme is only =
loosely =0A=
typed. Any suggestions? The format should be something =
like the =0A=
following (partial example):</DIV>=0A=
<DIV> </DIV>=0A=
<DIV>[ [(-,M)] [(T,a)(h,s)(-,t)(e,e)(-,r)(-,s)] =0A=
[(-,s)(h,t)(e,e)(-,r)(-,s)]]]. </DIV>=0A=
<DIV> </DIV>=0A=
<DIV>Once I get back my list, I need to pair everything up in order to =
return =0A=
a list of optimal solutions. Taking the previous example, it =
would be =0A=
the following when paired up correctly:</DIV>=0A=
<DIV> </DIV>=0A=
<DIV>[ [(-,M)(T,a)(h,s)(-,t)(e,e)(-,r)(-,s)], =0A=
[(-,M)(T,a)(-,s)(h,t)(e,e)(-,r)(-,s)] ] </DIV>=0A=
<DIV> </DIV>=0A=
<DIV>From there, I find which sequence has the maximum score. I =
then =0A=
walk through the list again, making a list of all the sequences that =
have that =0A=
score. These two steps seem fairly trivial, it's all the above =
stuff =0A=
which I'm struggling on.</DIV>=0A=
<DIV> </DIV>=0A=
<DIV>Rachel</DIV>=0A=
<DIV> </DIV>=0A=
<DIV><FONT size=3D2>-----Original Message----- <BR><B>From:</B> Marc =
Ziegert =0A=
[mailto:coeus@gmx.de] <BR><B>Sent:</B> Tue 3/25/2003 3:13 PM =
<BR><B>To:</B> =0A=
Weix, Rachel Lynn <BR><B>Cc:</B> <BR><B>Subject:</B> Re: Haskell =0A=
help!<BR><BR></DIV></FONT>=0A=
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">=0A=
<P><FONT size=3D2>maxSeq had one mistake: || instead of =
&&<BR><BR>i =0A=
will think about the problem itself, before rewriting =
all.<BR><BR>this is =0A=
the file a little bit more in haskell style.<BR><BR><BR><BR>Am =
Dienstag, 25. =0A=
M=E4rz 2003 20:16 schrieben Sie:<BR>> I found my two mistakes, =
plus I fixed =0A=
the method my Professor said was<BR>> incorrect. Now I just =
have to =0A=
be able to find ALL optimal solutions,<BR>> instead of just =
one. =0A=
Hooray!<BR>><BR>> =0A=
Rachel<BR></FONT></P></BLOCKQUOTE></BLOCKQUOTE>=0A=
=0A=
</BODY>=0A=
</HTML>
------_=_NextPart_001_01C2F3E7.9CD6E0DC--