help

Marc Ziegert coeus@gmx.de
Tue, 10 Dec 2002 11:32:03 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_000E_01C2A03F.C2D5CAD0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

what do you want to execute if you do not have a main function?

i.e. this LHS-file:

------------------------------------------------------------------
rzsjztj =E4=E4=E4=E4=E4=E4=E4=E4=E4strh=FC

> module Snoop where

rjst=F6h gitsh

> schnuck :: IO ()
> schnuck =3D putStr "schnuck"

sdfthsrthk

> gumble :: IO ()
> gumble =3D putStr "gumble"

srhthtr

> hurz :: IO ()
> hurz =3D gumble << schnuck << schnuck
>
> honk :: IO ()
> honk =3D do
>           schnuck
>           gumble
>           schnuck

shtr
------------------------------------------------------------------


you have to define the function, you want to execute as your =
main-programm.
so, just define a main::IO() function.
several modules (that you connect together) could have a main-function, =
so you have to define the main-module.
if you only have one module, you have to tell your compiler that it is a =
programm and not just a object-file.


----- Original Message -----=20
  From: Suja=20
  To: haskell@haskell.org=20
  Sent: Tuesday, December 10, 2002 9:50 AM
  Subject: help


  Hi,

  I want to know how to execute a haskell program that does not contain =
a main module. I would also like to know the difference between .lhs and =
.hs extensions.


------=_NextPart_000_000E_01C2A03F.C2D5CAD0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1126" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>what do you want to execute if you do =
not have a=20
main function?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i.e. this LHS-file:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>---------------------------------<FONT =
face=3DArial=20
size=3D2>---------------------------------</FONT></FONT></DIV></FONT><FON=
T=20
face=3DArial size=3D2>rzsjztj =
=E4=E4=E4=E4=E4=E4=E4=E4=E4strh=FC</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&gt; module Snoop where</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>rjst=F6h gitsh</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&gt; schnuck :: IO ()<BR>&gt; schnuck =
=3D putStr=20
"schnuck"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>sdfthsrthk</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&gt; gumble :: IO ()<BR>&gt; gumble =3D =
putStr=20
"gumble"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>srhthtr</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>&gt; hurz :: IO ()<BR>&gt; hurz =3D =
gumble &lt;&lt;=20
schnuck&nbsp;&lt;&lt; schnuck</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&gt; honk :: IO ()<BR>&gt; honk =3D =
do</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial=20
size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
=20
schnuck</FONT></DIV>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
&nbsp;gumble</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
=20
schnuck</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV></FONT></DIV></FONT><FONT=20
face=3DArial size=3D2>shtr</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>---------------------------------<FONT =
face=3DArial=20
size=3D2>---------------------------------</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV><FONT face=3DArial =
size=3D2>
<DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV>&nbsp;</DIV>
<DIV>you have to define the function, you want to execute as your=20
main-programm.</DIV>
<DIV>so, just define a main::IO() function.</DIV>
<DIV>several modules (that you connect together) could have a =
main-function, so=20
you have to define the main-module.</DIV>
<DIV>if you only have one module, you have to tell your compiler that it =
is a=20
programm and not just a object-file.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV></FONT></FONT>----- Original Message ----- </DIV></DIV></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Dsuja@haskell.org href=3D"mailto:suja@haskell.org">Suja</A> =
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dhaskell@haskell.org=20
  href=3D"mailto:haskell@haskell.org">haskell@haskell.org</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, December 10, =
2002 9:50=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> help</DIV>
  <DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT><FONT=20
  face=3DArial size=3D2></FONT><FONT face=3DArial size=3D2></FONT><FONT =
face=3DArial=20
  size=3D2></FONT><FONT face=3DArial size=3D2></FONT><FONT face=3DArial=20
  size=3D2></FONT><FONT face=3DArial size=3D2></FONT><FONT face=3DArial=20
  size=3D2></FONT><FONT face=3DArial size=3D2></FONT><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>I want to know how to execute a =
haskell program=20
  that does not contain a main module. I would also like to know the =
difference=20
  between .lhs and .hs extensions.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_000E_01C2A03F.C2D5CAD0--