[Haskell-beginners] Creating modules
Dananji Liyanage
dan9131 at gmail.com
Fri May 8 10:53:47 UTC 2015
Thanks Magnus!!
Got it to working.
On Fri, May 8, 2015 at 4:13 PM, Magnus Therning <magnus at therning.org> wrote:
> On 8 May 2015 at 11:00, Dananji Liyanage <dan9131 at gmail.com> wrote:
> > Hi All,
> >
> > I'm following this lecture[1] series and stuck at the module creation
> > section.
> >
> > Even though I understand the idea of the module I can't figure out the
> exact
> > syntax to module creation.
> >
> > Do we have to compile the Haskell file containing the module
> declaration?
> >
> > For an example:
> >
> > Do I have to compile this;
> >
> > module metricCalc(.....) where ...
> > in a file metricCalc.hs
>
> (First off, I believe module names must start with an uppercase
> letter, i.e. call it MetricCalc.)
>
> It depends on what you mean more exactly.
>
> You can use `ghci` to load the source file directly:
>
> ~~~
> Prelude> :l MetricCalc.hs
> *MetricCalc>
> ~~~
>
> If you use Cabal you can compile it and place it in a library which
> you subsequently can install, so that you can use it from other
> projects you work on.
>
> /M
>
> --
> Magnus Therning OpenPGP: 0xAB4DFBA4
> email: magnus at therning.org jabber: magnus at therning.org
> twitter: magthe http://therning.org/magnus
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
--
Regards,
Dananji Liyanage
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150508/c2c38006/attachment.html>
More information about the Beginners
mailing list