Re: [Haskell-cafe] Mystified by Cabal

2009-03-10 Thread Duncan Coutts
On Mon, 2009-03-09 at 17:56 -0700, John Meacham wrote:
 On Sun, Mar 08, 2009 at 01:13:33PM +0100, Svein Ove Aas wrote:
  On Sun, Mar 8, 2009 at 12:32 PM, Duncan Coutts
  duncan.cou...@worc.ox.ac.uk wrote:
   Note also that the list of licenses mkcabal offers is wrong. You can get
   the list from the Cabal lib itself so there is no need to maintain the
   list manually.
  
  It would also be nice to expand that list somewhat, to at least cover
  the most used licences - GPL2, GPL3, AGPL, etc.
 
 Why would cabal need a list at all inside of it? It seems very odd to
 have to upgrade cabal just because I am using a different license.
 
 it seems that we should just bite the bullet and switch data License to 
 
 newtype License = License String
 
 and simplify a lot of code to boot as well as create a normalized data
 layout.

Because it was not that way initially and changing away to something
more sensible takes time so that we do not cause unnecessary breakage.

Now it does allow any string at all. There are however a list of well
known licenses and the point of that is so that we can collectively use
the same name for the same thing. There's nothing however stopping you
from using a custom license. At the moment you cannot give a name in
the .cabal file to that custom license and upload it to hackage and I
think that's what you're getting at. If everyone agrees that's the way
to go then we can certainly change it.

The hard part was phasing out the fragile parser. We are now half way
through that cycle. When we no longer care about users of ghc-6.8 then
we can make use of the extra flexibility.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Mystified by Cabal

2009-03-09 Thread John Meacham
On Sun, Mar 08, 2009 at 01:13:33PM +0100, Svein Ove Aas wrote:
 On Sun, Mar 8, 2009 at 12:32 PM, Duncan Coutts
 duncan.cou...@worc.ox.ac.uk wrote:
  Note also that the list of licenses mkcabal offers is wrong. You can get
  the list from the Cabal lib itself so there is no need to maintain the
  list manually.
 
 It would also be nice to expand that list somewhat, to at least cover
 the most used licences - GPL2, GPL3, AGPL, etc.

Why would cabal need a list at all inside of it? It seems very odd to
have to upgrade cabal just because I am using a different license.

it seems that we should just bite the bullet and switch data License to 

newtype License = License String

and simplify a lot of code to boot as well as create a normalized data
layout.

John


-- 
John Meacham - ⑆repetae.net⑆john⑈
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Mystified by Cabal

2009-03-08 Thread Duncan Coutts
On Sat, 2009-03-07 at 17:30 +, Colin Paul Adams wrote:
  Svein == Svein Ove Aas svein@aas.no writes:
 
  Preprocessing library game-tree-1.0.0.0...  Building
  game-tree-1.0.0.0...
  
  Data/Tree/Game/Negascout.hs:31:0: Unrecognised pragma [1 of 2]
  Compiling Data.Tree.Game.Tree ( Data/Tree/Game/Tree.hs,
  dist/build/Data/Tree/Game/Tree.o )
  
  Data/Tree/Game/Tree.hs:1:0:Failed to load interface for
  `Prelude':  it is a member of package base-3.0.3.0, which
  is hidden
  
 Svein What does your .cabal file look like?

Don, mkcabal is generating .cabal files that are confusing people.

It should generate new-style .cabal files with library or executable
sections. The ghc-options and build-depends etc need to be in the lib or
exe section.

The files it generates are not actually broken but it leaves new users
to do the conversion from old style to new and unsurprisingly many get
that wrong. Cabal is also at fault here for not providing good
diagnostics but it would help if mkcabal used the current recommended
style.

Note also that the list of licenses mkcabal offers is wrong. You can get
the list from the Cabal lib itself so there is no need to maintain the
list manually.

I still think mkcabal should be integrated into cabal-install, like:
$ cabal init
or something. We could also more easily keep it up to date that way.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Mystified by Cabal

2009-03-08 Thread Svein Ove Aas
On Sun, Mar 8, 2009 at 12:32 PM, Duncan Coutts
duncan.cou...@worc.ox.ac.uk wrote:
 Note also that the list of licenses mkcabal offers is wrong. You can get
 the list from the Cabal lib itself so there is no need to maintain the
 list manually.

It would also be nice to expand that list somewhat, to at least cover
the most used licences - GPL2, GPL3, AGPL, etc.

-- 
Svein Ove Aas
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Mystified by Cabal

2009-03-08 Thread Duncan Coutts
On Sun, 2009-03-08 at 13:13 +0100, Svein Ove Aas wrote:
 On Sun, Mar 8, 2009 at 12:32 PM, Duncan Coutts
 duncan.cou...@worc.ox.ac.uk wrote:
  Note also that the list of licenses mkcabal offers is wrong. You can get
  the list from the Cabal lib itself so there is no need to maintain the
  list manually.
 
 It would also be nice to expand that list somewhat, to at least cover
 the most used licences - GPL2, GPL3, AGPL, etc.

Cabal HEAD adds MIT and versioned GPL and LGPL. We could not change it
much earlier because old Cabal versions (ie 1.2 and earlier) would have
barfed on parsing names it did not recognise.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Mystified by Cabal

2009-03-08 Thread Don Stewart
duncan.coutts:
 On Sat, 2009-03-07 at 17:30 +, Colin Paul Adams wrote:
   Svein == Svein Ove Aas svein@aas.no writes:
  
   Preprocessing library game-tree-1.0.0.0...  Building
   game-tree-1.0.0.0...
   
   Data/Tree/Game/Negascout.hs:31:0: Unrecognised pragma [1 of 2]
   Compiling Data.Tree.Game.Tree ( Data/Tree/Game/Tree.hs,
   dist/build/Data/Tree/Game/Tree.o )
   
   Data/Tree/Game/Tree.hs:1:0:Failed to load interface for
   `Prelude':  it is a member of package base-3.0.3.0, which
   is hidden
   
  Svein What does your .cabal file look like?
 
 Don, mkcabal is generating .cabal files that are confusing people.
 
 It should generate new-style .cabal files with library or executable
 sections. The ghc-options and build-depends etc need to be in the lib or
 exe section.
 
 The files it generates are not actually broken but it leaves new users
 to do the conversion from old style to new and unsurprisingly many get
 that wrong. Cabal is also at fault here for not providing good
 diagnostics but it would help if mkcabal used the current recommended
 style.
 
 Note also that the list of licenses mkcabal offers is wrong. You can get
 the list from the Cabal lib itself so there is no need to maintain the
 list manually.
 
 I still think mkcabal should be integrated into cabal-install, like:
 $ cabal init
 or something. We could also more easily keep it up to date that way.


mkcabal is unmaintained.


-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Mystified by Cabal

2009-03-07 Thread Svein Ove Aas
On Sat, Mar 7, 2009 at 6:18 PM, Colin Paul Adams
co...@colina.demon.co.uk wrote:
 I have just attempted Cabal-izing my program (splitting it into a
 library and main program as well), and I'm mystified by some problems
 I am having.

 First, when I try to build the library I get:

 [co...@susannah game-tree]$ runhaskell Setup build
 Preprocessing library game-tree-1.0.0.0...
 Building game-tree-1.0.0.0...

 Data/Tree/Game/Negascout.hs:31:0: Unrecognised pragma
 [1 of 2] Compiling Data.Tree.Game.Tree ( Data/Tree/Game/Tree.hs, 
 dist/build/Data/Tree/Game/Tree.o )

 Data/Tree/Game/Tree.hs:1:0:
    Failed to load interface for `Prelude':
      it is a member of package base-3.0.3.0, which is hidden

What does your .cabal file look like?



 Perhaps Cabal should be named Caballa instead.

Nah, it's not /that/ bad. :P

You might want to install the mkcabal package, use that to generate
the initial .cabal file. Though I'm not sure what you might have
gotten wrong.. well, show us the file first.

- Svein Ove
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Mystified by Cabal

2009-03-07 Thread Colin Paul Adams
 Svein == Svein Ove Aas svein@aas.no writes:

 Preprocessing library game-tree-1.0.0.0...  Building
 game-tree-1.0.0.0...
 
 Data/Tree/Game/Negascout.hs:31:0: Unrecognised pragma [1 of 2]
 Compiling Data.Tree.Game.Tree ( Data/Tree/Game/Tree.hs,
 dist/build/Data/Tree/Game/Tree.o )
 
 Data/Tree/Game/Tree.hs:1:0:    Failed to load interface for
 `Prelude':      it is a member of package base-3.0.3.0, which
 is hidden
 
Svein What does your .cabal file look like?

name:game-tree
version: 1.0.0.0
cabal-version:   = 1.6
synopsis:Searching game trees with alpha-beta pruning
description: A data type for game trees, as used in decision theory and 
game theory,
 along with standard algorithms for searching the tree 
using alpha-beta pruning.
 Can be used as the basis of an AI for two-player zero-sum  
games, such as chess.
category:Data
license: GPL
license-file:LICENSE
author:  Colin Adams
maintainer:  co...@colina.demon.co.uk
copyright:   Copyright: 2009 Colin Adams
build-type:  Simple
build-depends:   base = 4
ghc-options: -Wall -fno-warn-unrecognised-pragmas

Library
 exposed-modules: Data.Tree.Game.Tree, Data.Tree.Game.Negascout
source-repository head
 type: darcs
 location: http://code.haskell.org/game-tree/
-- 
Colin Adams
Preston Lancashire
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Mystified by Cabal

2009-03-07 Thread Robin Green
On Sat, 07 Mar 2009 17:30:43 +
Colin Paul Adams co...@colina.demon.co.uk wrote:

  Svein == Svein Ove Aas svein@aas.no writes:
 
  Preprocessing library game-tree-1.0.0.0...  Building
  game-tree-1.0.0.0...
  
  Data/Tree/Game/Negascout.hs:31:0: Unrecognised pragma [1 of 2]
  Compiling Data.Tree.Game.Tree ( Data/Tree/Game/Tree.hs,
  dist/build/Data/Tree/Game/Tree.o )
  
  Data/Tree/Game/Tree.hs:1:0:    Failed to load interface for
  `Prelude':      it is a member of package base-3.0.3.0, which
  is hidden
  
 Svein What does your .cabal file look like?
 
 name:game-tree
 version: 1.0.0.0
 cabal-version:   = 1.6
 synopsis:Searching game trees with alpha-beta pruning
 description: A data type for game trees, as used in decision
 theory and game theory, along with standard algorithms for searching
 the tree using alpha-beta pruning. Can be used as the basis of an AI
 for two-player zero-sum  games, such as chess. category:
 Data license: GPL
 license-file:LICENSE
 author:  Colin Adams
 maintainer:  co...@colina.demon.co.uk
 copyright:   Copyright: 2009 Colin Adams
 build-type:  Simple
 build-depends:   base = 4
 ghc-options: -Wall -fno-warn-unrecognised-pragmas
 
 Library
  exposed-modules: Data.Tree.Game.Tree, Data.Tree.Game.Negascout
 source-repository head
  type: darcs
  location: http://code.haskell.org/game-tree/

The build-depends line needs to go in the Library section, I think. It
doesn't seem to be having any effect in its current location. Likewise
for ghc-options.
-- 
Robin
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Mystified by Cabal

2009-03-07 Thread Colin Paul Adams
 Robin == Robin Green gree...@greenrd.org writes:

Robin The build-depends line needs to go in the Library section,
Robin I think. It doesn't seem to be having any effect in its
Robin current location. Likewise for ghc-options.

Thanks everyone - it's working now.
-- 
Colin Adams
Preston Lancashire
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Mystified by Cabal

2009-03-07 Thread Don Stewart
colin:
 I have just attempted Cabal-izing my program (splitting it into a
 library and main program as well), and I'm mystified by some problems
 I am having.
 
 First, when I try to build the library I get:
 
 [co...@susannah game-tree]$ runhaskell Setup build
 Preprocessing library game-tree-1.0.0.0...
 Building game-tree-1.0.0.0...
 
 Data/Tree/Game/Negascout.hs:31:0: Unrecognised pragma
 [1 of 2] Compiling Data.Tree.Game.Tree ( Data/Tree/Game/Tree.hs, 
 dist/build/Data/Tree/Game/Tree.o )
 
 Data/Tree/Game/Tree.hs:1:0:
 Failed to load interface for `Prelude':
   it is a member of package base-3.0.3.0, which is hidden
 

build-depends: base

You certainly depend on the base library, unless you're doing only
haskell98 work.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe