Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. cabal: library and executable (harry)
2. Re: cabal: library and executable (emacstheviking)
3. Re: cabal: library and executable (emacstheviking)
4. Re: cabal: library and executable (harry)
5. Re: cabal: library and executable (David McBride)
----------------------------------------------------------------------
Message: 1
Date: Thu, 9 May 2013 15:24:29 +0000 (UTC)
From: harry <[email protected]>
Subject: [Haskell-beginners] cabal: library and executable
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
I've written a library, and a simple program to demonstrate it. I can write
the cabal file for the library, but I can't get the executable section
right. How can I tell it to use the library defined herein?
------------------------------
Message: 2
Date: Thu, 9 May 2013 16:38:15 +0100
From: emacstheviking <[email protected]>
Subject: Re: [Haskell-beginners] cabal: library and executable
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Message-ID:
<caeieuul1x0ok3vinhftca++jb5_yf35bb0a0r8vxu8zr+vj...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Harry,
Here is a complete cabal file for something I am working on now... it
contains some libraries and three executables that use the library. It's a
WIP for me BUt it works and I can even use it from Leksah by creating a
workspace and adding this hexwax.cabal file as a Package.
It's long but concise!
----
-- Initial hexwax.cabal generated by cabal init. For further
-- documentation, see http://haskell.org/cabal/users-guide/
-- The name of the package.
name: hexwax
-- The package version. See the Haskell package versioning policy (PVP)
-- for standards guiding when and how versions should be incremented.
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
-- PVP summary: +-+------- breaking API changes
-- | | +----- non-breaking API additions
-- | | | +--- code changes with no API change
version: 0.1.0.0
-- A short (one-line) description of the package.
synopsis: Hexwax ExnapdIO-USB wrapper
-- A longer description of the package.
-- description:
-- The license under which the package is released.
license: LGPL-3
-- The file containing the license text.
license-file: LICENSE
-- The package author(s).
author: Sean Charles
-- An email address to which users can send suggestions, bug reports, and
-- patches.
maintainer: [email protected]
-- A copyright notice.
-- copyright:
category: Hardware Interfacing
build-type: Simple
-- Constraint on the version of Cabal needed to build this package.
cabal-version: >=1.8
executable hexwax
-- .hs or .lhs file containing the Main module.
main-is: usb1.hs
-- Modules included in this executable, other than Main.
other-modules: Hexwax
-- Other library packages from which modules are imported.
build-depends: base ==4.5.*, MissingM ==0.0.*, bytestring ==0.9.*,
vector ==0.10.*, usb ==1.2.*
--
-- This is the STEPPER MOTOR CONTROLLER program as I want to create
-- separate little utilities rather than one big monolithic command
-- line bloated application.
--
executable smc
-- .hs or .lhs file containing the Main module.
main-is: stepper.hs
-- Modules included in this executable, other than Main.
other-modules: Hexwax
-- Other library packages from which modules are imported.
build-depends: base ==4.5.*, MissingM ==0.0.*, bytestring ==0.9.*,
vector ==0.10.*, usb ==1.2.*, transformers
--
-- PULSE-WIDTH-MODULATION controller experiment... two leds on the board are
-- connected to CCP1 and CCP2, this will try to make them do something
-- interesting. executable pwm
--
executable pwm
-- .hs or .lhs file containing the Main module.
main-is: pwm.hs
-- Modules included in this executable, other than Main.
other-modules: Hexwax
-- Other library packages from which modules are imported.
build-depends: base ==4.5.*, MissingM ==0.0.*, bytestring ==0.9.*,
vector ==0.10.*, usb ==1.2.*, transformers
On 9 May 2013 16:24, harry <[email protected]> wrote:
> I've written a library, and a simple program to demonstrate it. I can write
> the cabal file for the library, but I can't get the executable section
> right. How can I tell it to use the library defined herein?
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20130509/ab0d5d43/attachment-0001.htm>
------------------------------
Message: 3
Date: Thu, 9 May 2013 16:39:49 +0100
From: emacstheviking <[email protected]>
Subject: Re: [Haskell-beginners] cabal: library and executable
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Message-ID:
<caeieuujbij3txmp616uvwjud_walthofzt4rtejoxhfekaa...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Maybe two executables, the "third" is actually straight C... the line of
interest is "other-modules:" I guess.
Hope that helps.
Sean.
On 9 May 2013 16:38, emacstheviking <[email protected]> wrote:
> Harry,
>
> Here is a complete cabal file for something I am working on now... it
> contains some libraries and three executables that use the library. It's a
> WIP for me BUt it works and I can even use it from Leksah by creating a
> workspace and adding this hexwax.cabal file as a Package.
>
> It's long but concise!
>
> ----
> -- Initial hexwax.cabal generated by cabal init. For further
> -- documentation, see http://haskell.org/cabal/users-guide/
>
> -- The name of the package.
> name: hexwax
>
> -- The package version. See the Haskell package versioning policy (PVP)
> -- for standards guiding when and how versions should be incremented.
> -- http://www.haskell.org/haskellwiki/Package_versioning_policy
> -- PVP summary: +-+------- breaking API changes
> -- | | +----- non-breaking API additions
> -- | | | +--- code changes with no API change
> version: 0.1.0.0
>
> -- A short (one-line) description of the package.
> synopsis: Hexwax ExnapdIO-USB wrapper
>
> -- A longer description of the package.
> -- description:
>
> -- The license under which the package is released.
> license: LGPL-3
>
> -- The file containing the license text.
> license-file: LICENSE
>
> -- The package author(s).
> author: Sean Charles
>
> -- An email address to which users can send suggestions, bug reports, and
> -- patches.
> maintainer: [email protected]
>
> -- A copyright notice.
> -- copyright:
>
> category: Hardware Interfacing
>
> build-type: Simple
>
> -- Constraint on the version of Cabal needed to build this package.
> cabal-version: >=1.8
>
>
> executable hexwax
> -- .hs or .lhs file containing the Main module.
> main-is: usb1.hs
> -- Modules included in this executable, other than Main.
> other-modules: Hexwax
> -- Other library packages from which modules are imported.
> build-depends: base ==4.5.*, MissingM ==0.0.*, bytestring ==0.9.*,
> vector ==0.10.*, usb ==1.2.*
>
> --
> -- This is the STEPPER MOTOR CONTROLLER program as I want to create
> -- separate little utilities rather than one big monolithic command
> -- line bloated application.
> --
> executable smc
> -- .hs or .lhs file containing the Main module.
> main-is: stepper.hs
> -- Modules included in this executable, other than Main.
> other-modules: Hexwax
> -- Other library packages from which modules are imported.
> build-depends: base ==4.5.*, MissingM ==0.0.*, bytestring ==0.9.*,
> vector ==0.10.*, usb ==1.2.*, transformers
>
>
> --
> -- PULSE-WIDTH-MODULATION controller experiment... two leds on the board
> are
> -- connected to CCP1 and CCP2, this will try to make them do something
> -- interesting. executable pwm
> --
> executable pwm
> -- .hs or .lhs file containing the Main module.
> main-is: pwm.hs
> -- Modules included in this executable, other than Main.
> other-modules: Hexwax
> -- Other library packages from which modules are imported.
> build-depends: base ==4.5.*, MissingM ==0.0.*, bytestring ==0.9.*,
> vector ==0.10.*, usb ==1.2.*, transformers
>
> On 9 May 2013 16:24, harry <[email protected]> wrote:
>
>> I've written a library, and a simple program to demonstrate it. I can
>> write
>> the cabal file for the library, but I can't get the executable section
>> right. How can I tell it to use the library defined herein?
>>
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20130509/975855cf/attachment-0001.htm>
------------------------------
Message: 4
Date: Thu, 9 May 2013 15:45:52 +0000 (UTC)
From: harry <[email protected]>
Subject: Re: [Haskell-beginners] cabal: library and executable
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
emacstheviking <objitsu <at> gmail.com> writes:
...
Where's the library definition? I could only find executables
------------------------------
Message: 5
Date: Thu, 9 May 2013 11:54:17 -0400
From: David McBride <[email protected]>
Subject: Re: [Haskell-beginners] cabal: library and executable
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Message-ID:
<CAN+Tr41LWpbzoV2-wjeR8GaG-9XB-ieXdkWO92Qw8g2Uxw=c...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
You can go to hackage and check out the "package description" link
within any package page and that is just a .cabal file. Here is an
example that has both a library and an executable:
http://hackage.haskell.org/packages/archive/manatee-editor/0.1.1/manatee-editor.cabal
On Thu, May 9, 2013 at 11:24 AM, harry <[email protected]> wrote:
> I've written a library, and a simple program to demonstrate it. I can write
> the cabal file for the library, but I can't get the executable section
> right. How can I tell it to use the library defined herein?
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 59, Issue 8
****************************************