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 modules and directories (Rehno Lindeque)
   2. Re:  Cabal modules and directories (Daniel Fischer)
   3. Re:  Cabal modules and directories (Rehno Lindeque)
   4. Re:  Cabal modules and directories (Rehno Lindeque)
   5. Re:  Cabal modules and directories (Daniel Fischer)
   6. Re:  Cabal modules and directories (Rehno Lindeque)
   7.  Re: [Haskell-cafe] how to send a string to a     tuple
      (Magnus Therning)
   8. Re:  Cabal modules and directories (Daniel Fischer)
   9. Re:  Cabal modules and directories (Rehno Lindeque)


----------------------------------------------------------------------

Message: 1
Date: Wed, 3 Mar 2010 20:57:13 +0200
From: Rehno Lindeque <[email protected]>
Subject: [Haskell-beginners] Cabal modules and directories
To: [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

I'm sorry because this is a very elementary question but despite my attempts
I can't seem to get cabal working for my project structure.

I have two main source directories:
  src\haskell
  src\semanticdb

Inside src\haskell I have main.hs with the module Main.
Inside src\semanticdb I have semanticdb.hs with module OSIX.SemanticDB

My cabal file contains the following 3 lines:
  main-is: main.hs
  hs-source-dirs: src/haskell src/semanticdb
  other-modules: OSIX.SemanticDB

Then when I build with 'cabal build' I get the following error:
  cabal: can't find source for OSIX.SemanticDB in src/haskell,
src/semanticdb, dist/build/autogen

cabal --version gives:
  cabal-install version 0.6.4
  using version 1.6.0.3 of the Cabal library

I'd prefer to keep my directory structure as is if possible, but it doesn't
seem to be working for me... Is there anything I can do or should I just
restructure the directories?
(NOTE: I'm using leksah as my IDE, so the cabal file is mostly generated
automatically)

Thanks,
-Rehno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20100303/452fe884/attachment-0001.html

------------------------------

Message: 2
Date: Wed, 3 Mar 2010 20:19:24 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Cabal modules and directories
To: [email protected]
Cc: Rehno Lindeque <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain;  charset="utf-8"

Am Mittwoch 03 März 2010 19:57:13 schrieb Rehno Lindeque:
> I'm sorry because this is a very elementary question but despite my
> attempts I can't seem to get cabal working for my project structure.
>
> I have two main source directories:
>   src\haskell
>   src\semanticdb
>
> Inside src\haskell I have main.hs with the module Main.
> Inside src\semanticdb I have semanticdb.hs with module OSIX.SemanticDB

module OSIX.SemanticDB

must be in the file 'SemanticDB.hs' (or .lhs), in the subdirectory OSIX of 
the source directory listed in the .cabal file, here src/semanticdb, so

file:

src/semanticdb/OSIX/SemanticDB.hs

>
> My cabal file contains the following 3 lines:
>   main-is: main.hs
>   hs-source-dirs: src/haskell src/semanticdb
>   other-modules: OSIX.SemanticDB

That is in an executable-stanza,

executable whatever
  main-is:   ...

, right?

>
> Then when I build with 'cabal build'

Did you `cabal configure` before?

> I get the following error:
>   cabal: can't find source for OSIX.SemanticDB in src/haskell,
> src/semanticdb, dist/build/autogen
>
> cabal --version gives:
>   cabal-install version 0.6.4
>   using version 1.6.0.3 of the Cabal library
>
> I'd prefer to keep my directory structure as is if possible, but it
> doesn't seem to be working for me... Is there anything I can do or
> should I just restructure the directories?
> (NOTE: I'm using leksah as my IDE, so the cabal file is mostly generated
> automatically)
>
> Thanks,
> -Rehno



------------------------------

Message: 3
Date: Wed, 3 Mar 2010 21:35:41 +0200
From: Rehno Lindeque <[email protected]>
Subject: Re: [Haskell-beginners] Cabal modules and directories
To: beginners <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

On Wed, Mar 3, 2010 at 9:19 PM, Daniel Fischer <[email protected]>wrote:

> Am Mittwoch 03 März 2010 19:57:13 schrieb Rehno Lindeque:
> > I'm sorry because this is a very elementary question but despite my
> > attempts I can't seem to get cabal working for my project structure.
> >
> > I have two main source directories:
> >   src\haskell
> >   src\semanticdb
> >
> > Inside src\haskell I have main.hs with the module Main.
> > Inside src\semanticdb I have semanticdb.hs with module OSIX.SemanticDB
>
> module OSIX.SemanticDB
>
> must be in the file 'SemanticDB.hs' (or .lhs), in the subdirectory OSIX of
> the source directory listed in the .cabal file, here src/semanticdb, so
>

Thanks, moving the file to src/semanticdb/OSIX works. However, I would
prefer it if restructuring my directories weren't necessary. Is it possible?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.haskell.org/pipermail/beginners/attachments/20100303/7dfe1e1f/attachment-0001.html

------------------------------

Message: 4
Date: Wed, 3 Mar 2010 21:54:21 +0200
From: Rehno Lindeque <[email protected]>
Subject: Re: [Haskell-beginners] Cabal modules and directories
To: beginners <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Mar 3, 2010 at 9:35 PM, Rehno Lindeque <[email protected]> wrote:
>
>
> On Wed, Mar 3, 2010 at 9:19 PM, Daniel Fischer <[email protected]> 
> wrote:
>>
>> Am Mittwoch 03 März 2010 19:57:13 schrieb Rehno Lindeque:
>> > I'm sorry because this is a very elementary question but despite my
>> > attempts I can't seem to get cabal working for my project structure.
>> >
>> > I have two main source directories:
>> >   src\haskell
>> >   src\semanticdb
>> >
>> > Inside src\haskell I have main.hs with the module Main.
>> > Inside src\semanticdb I have semanticdb.hs with module OSIX.SemanticDB
>>
>> module OSIX.SemanticDB
>>
>> must be in the file 'SemanticDB.hs' (or .lhs), in the subdirectory OSIX of
>> the source directory listed in the .cabal file, here src/semanticdb, so
>
> Thanks, moving the file to src/semanticdb/OSIX works. However, I would prefer 
> it if restructuring my directories weren't necessary. Is it possible?
>

Perhaps I should add that the project isn't haskell-only and already
has some conventions in place such as using lower case for directories
etc. Thus I prefer not to change these. Compilation worked with the
current directory structure using a makefile but I can't duplicate the
feat with cabal. Is there a work-around perhaps?

Also, the 'executable' part and 'cabal configure' is correct, yes :)


------------------------------

Message: 5
Date: Wed, 3 Mar 2010 20:59:29 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Cabal modules and directories
To: [email protected]
Cc: Rehno Lindeque <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain;  charset="utf-8"

Am Mittwoch 03 März 2010 20:35:41 schrieb Rehno Lindeque:
> Thanks, moving the file to src/semanticdb/OSIX works. However, I would
> prefer it if restructuring my directories weren't necessary. Is it
> possible?

No, the hierarchical module names map directly to the directory structure, 
module A.B.C must be in the file C.[l]hs in the directory A/B, viewed from 
the root of the source tree (the directory you name in hs-source-dirs).


------------------------------

Message: 6
Date: Wed, 3 Mar 2010 22:08:07 +0200
From: Rehno Lindeque <[email protected]>
Subject: Re: [Haskell-beginners] Cabal modules and directories
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Mar 3, 2010 at 9:59 PM, Daniel Fischer <[email protected]> wrote:
> Am Mittwoch 03 März 2010 20:35:41 schrieb Rehno Lindeque:
>> Thanks, moving the file to src/semanticdb/OSIX works. However, I would
>> prefer it if restructuring my directories weren't necessary. Is it
>> possible?
>
> No, the hierarchical module names map directly to the directory structure,
> module A.B.C must be in the file C.[l]hs in the directory A/B, viewed from
> the root of the source tree (the directory you name in hs-source-dirs).
>

Right, thank you. Then perhaps I will try and separate the SemanticDB
into a separate cabal project and try to add it as a dependency.
Thanks for the help.


------------------------------

Message: 7
Date: Wed, 03 Mar 2010 20:11:21 +0000
From: Magnus Therning <[email protected]>
Subject: [Haskell-beginners] Re: [Haskell-cafe] how to send a string
        to a    tuple
To: beginners <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

On 03/03/10 19:51, Pradeep Wickramanayake wrote:
> Hi
> 
> I have taken a string output from a file
> 
> But I want to send that string to another function which will convert in
> to a tuple
> 
> Can someone teach me please

May I suggest that you move this over to haskell-beginners instead?

Also, include any code you have so far.  You're more likely to get answers if
you include the code you are having problems with.

/M

-- 
Magnus Therning                        (OpenPGP: 0xAB4DFBA4)
magnus@therning.org          Jabber: magnus@therning.org
http://therning.org/magnus         identi.ca|twitter: magthe

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
Url : 
http://www.haskell.org/pipermail/beginners/attachments/20100303/765ba21d/signature-0001.bin

------------------------------

Message: 8
Date: Thu, 4 Mar 2010 18:11:49 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Cabal modules and directories
To: Rehno Lindeque <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain;  charset="iso-8859-1"

Am Mittwoch 03 März 2010 21:08:07 schrieb Rehno Lindeque:
> On Wed, Mar 3, 2010 at 9:59 PM, Daniel Fischer <[email protected]> 
wrote:
> > Am Mittwoch 03 März 2010 20:35:41 schrieb Rehno Lindeque:
> >> Thanks, moving the file to src/semanticdb/OSIX works. However, I
> >> would prefer it if restructuring my directories weren't necessary. Is
> >> it possible?
> >
> > No, the hierarchical module names map directly to the directory
> > structure, module A.B.C must be in the file C.[l]hs in the directory
> > A/B, viewed from the root of the source tree (the directory you name
> > in hs-source-dirs).

Ah, actually I misremembered, according to

http://hackage.haskell.org/trac/haskell-
prime/wiki/DottedHierarchicalModules

you can also have the file with dots in the filename.

>
> Right, thank you. Then perhaps I will try and separate the SemanticDB
> into a separate cabal project and try to add it as a dependency.
> Thanks for the help.



------------------------------

Message: 9
Date: Thu, 4 Mar 2010 19:40:19 +0200
From: Rehno Lindeque <[email protected]>
Subject: Re: [Haskell-beginners] Cabal modules and directories
To: [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Mar 4, 2010 at 7:11 PM, Daniel Fischer <[email protected]> wrote:
> Am Mittwoch 03 März 2010 21:08:07 schrieb Rehno Lindeque:
>> On Wed, Mar 3, 2010 at 9:59 PM, Daniel Fischer <[email protected]>
> wrote:
>> > Am Mittwoch 03 März 2010 20:35:41 schrieb Rehno Lindeque:
>> >> Thanks, moving the file to src/semanticdb/OSIX works. However, I
>> >> would prefer it if restructuring my directories weren't necessary. Is
>> >> it possible?
>> >
>> > No, the hierarchical module names map directly to the directory
>> > structure, module A.B.C must be in the file C.[l]hs in the directory
>> > A/B, viewed from the root of the source tree (the directory you name
>> > in hs-source-dirs).
>
> Ah, actually I misremembered, according to
>
> http://hackage.haskell.org/trac/haskell-
> prime/wiki/DottedHierarchicalModules
>
> you can also have the file with dots in the filename.

Mmm, I tried it out but it doesn't seem to work for me. I found this
extensions support matrix on
http://hackage.haskell.org/trac/haskell-prime/wiki/HaskellExtensions
that indicates that GHC doesn't support DottedHierarchicalModules. It
appears to be a JHC extension...


------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 21, Issue 2
****************************************

Reply via email to