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. Re:  fail: wxhaskell with cabal (Josh Bronson)
   2. Re:  fail: wxhaskell with cabal (Josh Bronson)
   3. Re:  fail: wxhaskell with cabal (Daniel Fischer)
   4. Re:  fail: wxhaskell with cabal (Josh Bronson)
   5. Re:  fail: wxhaskell with cabal (Daniel Fischer)
   6.  Pattern matching with one, two or more arguments (legajid)
   7. Re:  Pattern matching with one, two or more       arguments
      (Deniz Dogan)
   8. Re:  Pattern matching with one, two or more       arguments
      (Brent Yorgey)


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

Message: 1
Date: Fri, 27 Nov 2009 10:41:14 -0600
From: Josh Bronson <[email protected]>
Subject: Re: [Haskell-beginners] fail: wxhaskell with cabal
To: Chadda? Fouch? <[email protected]>
Cc: [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Yes, I've installed libwxbase2.8-dev:

$ dpkg -l 'libwxbase2.8*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  libwxbase2.8-0 2.8.10.1-0ubun wxBase library (runtime) - non-GUI support c
ii  libwxbase2.8-d 2.8.10.1-0ubun wxBase library (development) - non-GUI suppo
$ dpkg -L libwxbase2.8-dev
/.
/usr
/usr/lib
/usr/lib/wx
/usr/lib/wx/include
/usr/lib/wx/include/base-unicode-release-2.8
/usr/lib/wx/include/base-unicode-release-2.8/wx
/usr/lib/wx/include/base-unicode-release-2.8/wx/setup.h
/usr/lib/wx/config
/usr/lib/wx/config/base-unicode-release-2.8
/usr/share
/usr/share/doc
/usr/share/doc/libwxbase2.8-dev
/usr/share/doc/libwxbase2.8-dev/changelog.gz
/usr/share/doc/libwxbase2.8-dev/copyright
/usr/share/doc/libwxbase2.8-dev/changelog.Debian.gz
/usr/lib/libwx_baseu-2.8.so
/usr/lib/libwx_baseu_net-2.8.so
/usr/lib/libwx_baseu_xml-2.8.so

On Fri, Nov 27, 2009 at 12:34 AM, Chaddaï Fouché
<[email protected]> wrote:
> On Fri, Nov 27, 2009 at 5:06 AM, Josh Bronson <[email protected]> wrote:
>> Now I am trying to get wxhaskell to install:
>>
>> $ cabal install wx
>> [snip]
>> Configuring wxcore-0.12.1.2...
>> setup: Missing dependencies on foreign libraries:
>> * Missing C libraries: wx_baseu-2.8, wx_baseu_net-2.8, wx_baseu_xml-2.8
>> This problem can usually be solved by installing the system packages that
>> provide these libraries (you may need the "-dev" versions). If the libraries
>> are already installed but in a non-standard location then you can use the
>> flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
>> cabal: Error: some packages failed to install:
>> wx-0.12.1.2 depends on wxcore-0.12.1.2 which failed to install.
>> wxcore-0.12.1.2 failed during the configure step. The exception was:
>> exit: ExitFailure 1
>>
>> $ ls /usr/lib/libwx*
>> /usr/lib/libwx_baseu-2.8.so        /usr/lib/libwx_baseu_net-2.8.so.0.6.0
>> /usr/lib/libwx_baseu-2.8.so.0      /usr/lib/libwx_baseu_xml-2.8.so
>> /usr/lib/libwx_baseu-2.8.so.0.6.0  /usr/lib/libwx_baseu_xml-2.8.so.0
>> /usr/lib/libwx_baseu_net-2.8.so    /usr/lib/libwx_baseu_xml-2.8.so.0.6.0
>> /usr/lib/libwx_baseu_net-2.8.so.0
>>
>> It looks like the libraries are there to me! any ideas?
>
> The shared libraries are there, but did you check if the miscellaneous
> headers were there ? In other word did you install the libwx*-dev
> packages as invited to do by cabal in its error message ?
>
> --
> Jedaï
>


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

Message: 2
Date: Fri, 27 Nov 2009 10:51:08 -0600
From: Josh Bronson <[email protected]>
Subject: Re: [Haskell-beginners] fail: wxhaskell with cabal
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Hmm, there is no file of the type you mentioned:

$ ls /usr/lib/pkgconfig/wx*
ls: cannot access /usr/lib/pkgconfig/wx*: No such file or directory

A Google search for "wx pkg-config" appears to reveal that wxwidgets
does not support pkg-config, or at least it didn't a few years ago.
Lots of people will try "cabal install wx," right? So it seems like
that's probably not the problem, but I'm not sure where the code that
is generating the following output lives:

Configuring wxcore-0.12.1.2...
setup: Missing dependencies on foreign libraries:
* Missing C libraries: wx_baseu-2.8, wx_baseu_net-2.8, wx_baseu_xml-2.8

I tried untarring
~/.cabal/packages/hackage.haskell.org/wxcore/0.12.1.2/wxcore-0.12.1.2.tar.gz
and looking at Setup.hs to no avail. If I could see what test is
failing, I could probably figure it out.

On Thu, Nov 26, 2009 at 10:19 PM, Daniel Fischer
<[email protected]> wrote:
> Am Freitag 27 November 2009 05:06:21 schrieb Josh Bronson:
>> Greetings Haskellers,
>>
>> Happy Thanksgiving! I'm using Ubuntu 9.10. I've performed the following
>> steps:
>>
>> # apt-get install ghc6
>>
>> I then successfully did a local install of the Haskell platform in
>> ~/mine/install
>>
>> Now I am trying to get wxhaskell to install:
>>
>> $ cabal install wx
>> [snip]
>> Configuring wxcore-0.12.1.2...
>> setup: Missing dependencies on foreign libraries:
>> * Missing C libraries: wx_baseu-2.8, wx_baseu_net-2.8, wx_baseu_xml-2.8
>> This problem can usually be solved by installing the system packages that
>> provide these libraries (you may need the "-dev" versions). If the
>> libraries are already installed but in a non-standard location then you can
>> use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where
>> they are. cabal: Error: some packages failed to install:
>> wx-0.12.1.2 depends on wxcore-0.12.1.2 which failed to install.
>> wxcore-0.12.1.2 failed during the configure step. The exception was:
>> exit: ExitFailure 1
>>
>> $ ls /usr/lib/libwx*
>> /usr/lib/libwx_baseu-2.8.so      /usr/lib/libwx_baseu_net-2.8.so.0.6.0
>> /usr/lib/libwx_baseu-2.8.so.0    /usr/lib/libwx_baseu_xml-2.8.so
>> /usr/lib/libwx_baseu-2.8.so.0.6.0  /usr/lib/libwx_baseu_xml-2.8.so.0
>> /usr/lib/libwx_baseu_net-2.8.so    /usr/lib/libwx_baseu_xml-2.8.so.0.6.0
>> /usr/lib/libwx_baseu_net-2.8.so.0
>>
>> It looks like the libraries are there to me! any ideas?
>
> Perhaps cabal configure uses pkg-config to detect those libraries and you 
> have no
> wx_***.pc in /usr/lib/pkgconfig ?
> That occasionally happens to me.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>


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

Message: 3
Date: Fri, 27 Nov 2009 20:07:39 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] fail: wxhaskell with cabal
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain;  charset="utf-8"

Am Freitag 27 November 2009 17:51:08 schrieb Josh Bronson:
> Hmm, there is no file of the type you mentioned:
>
> $ ls /usr/lib/pkgconfig/wx*
> ls: cannot access /usr/lib/pkgconfig/wx*: No such file or directory
>
> A Google search for "wx pkg-config" appears to reveal that wxwidgets
> does not support pkg-config, or at least it didn't a few years ago.
> Lots of people will try "cabal install wx," right?

Dunno, I just tried, for me it dies with:

<snip more warnings>
src/cpp/eljdirdlg.cpp:24:0:
     warning: ‘void wxDirDialogBase::SetStyle(long int)’ is deprecated 
(declared at 
/usr/include/wx-2.8/wx/dirdlg.h:79)
src/cpp/eljdirdlg.cpp: In function ‘int wxDirDialog_GetStyle(void*)’:

src/cpp/eljdirdlg.cpp:45:0:
     warning: ‘long int wxDirDialogBase::GetStyle() const’ is deprecated 
(declared at 
/usr/include/wx-2.8/wx/dirdlg.h:78)
src/cpp/eljevent.cpp: In function ‘int expEVT_DIALUP_CONNECTED()’:

src/cpp/eljevent.cpp:1589:0:
     error: ‘wxEVT_DIALUP_CONNECTED’ was not declared in this scope
src/cpp/eljevent.cpp: In function ‘int expEVT_DIALUP_DISCONNECTED()’:

src/cpp/eljevent.cpp:1598:0:
     error: ‘wxEVT_DIALUP_DISCONNECTED’ was not declared in this scope
cabal: Error: some packages failed to install:
wx-0.12.1.2 depends on wxcore-0.12.1.2 which failed to install.
wxcore-0.12.1.2 failed during the building phase. The exception was:
exit: ExitFailure 1

Which reminds me, I've *never* succeeded building wxhaskell, I wonder how many 
managed.

> So it seems like that's probably not the problem, but I'm not sure where the 
> code that
> is generating the following output lives:
>
> Configuring wxcore-0.12.1.2...
> setup: Missing dependencies on foreign libraries:
> * Missing C libraries: wx_baseu-2.8, wx_baseu_net-2.8, wx_baseu_xml-2.8
>
> I tried untarring
> ~/.cabal/packages/hackage.haskell.org/wxcore/0.12.1.2/wxcore-0.12.1.2.tar.g
>z and looking at Setup.hs to no avail. If I could see what test is
> failing, I could probably figure it out.
>

Specify the locations via --extra-include-dirs and --extra-lib-dirs?


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

Message: 4
Date: Fri, 27 Nov 2009 15:22:03 -0600
From: Josh Bronson <[email protected]>
Subject: Re: [Haskell-beginners] fail: wxhaskell with cabal
To: Daniel Fischer <[email protected]>
Cc: [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

Ah. Is there a better GUI library to work with? Is cabal along with
the Haskell Platform a good idea? Or is it better to just stick with
libraries that install natively using APT on Ubuntu? I'm just trying
to write a little GUI application (John Conway's Game of Life) to
learn Haskell.

Thanks,
Josh

On Fri, Nov 27, 2009 at 1:07 PM, Daniel Fischer
<[email protected]> wrote:
> Which reminds me, I've *never* succeeded building wxhaskell, I wonder how 
> many managed.


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

Message: 5
Date: Fri, 27 Nov 2009 23:18:55 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] fail: wxhaskell with cabal
To: Josh Bronson <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain;  charset="iso-8859-1"

Am Freitag 27 November 2009 22:22:03 schrieb Josh Bronson:
> Ah. Is there a better GUI library to work with?

I don't know which one is 'better' for what purposes, but gtk2hs is much used.
It is unfortunately, as far as I know, not cabalised, so you'd have to manually 
install 
it.

> Is cabal along with
> the Haskell Platform a good idea? Or is it better to just stick with
> libraries that install natively using APT on Ubuntu? I'm just trying

Don't know if it's still true, but the debian packages used to lag far behind 
hackage, so 
that used to not be a serious option. If nowadays the debian-haskell packagers 
are up to 
speed, apt-get has advantages over cabal install.

> to write a little GUI application (John Conway's Game of Life) to
> learn Haskell.
>
> Thanks,
> Josh
>
> On Fri, Nov 27, 2009 at 1:07 PM, Daniel Fischer
>
> <[email protected]> wrote:
> > Which reminds me, I've *never* succeeded building wxhaskell, I wonder how
> > many managed.

This is now no longer true. I read the header "dialup.h" and replaced the 
"undeclared" 
macros wxEVT_DIALUP_(DIS)CONNECTED with the appropriate values in eljevent.cpp, 
then 
wxcore built and afterwards also wx. I haven't tested it, so it may be broken, 
but if it 
is, that shouldn't be the cause, I think.


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

Message: 6
Date: Sun, 29 Nov 2009 18:41:22 +0100
From: legajid <[email protected]>
Subject: [Haskell-beginners] Pattern matching with one, two or more
        arguments
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hello,
I'm writing a little word game that consists of the following : between 
a consonant and a vowel, insert "AV" so "fabien" becomes "fAVabAVien".

When i type : f "fabine", the result is ok ("fAVabAVinAVe")
When i type : f "fabien", the result is fAVabAVie *** exception :prelude 
empty list

Here's my program

voyelles="aeiouy"
consonnes="bcdfghjklmnpqrstvwxz"

est_voyelle x = x `elem` voyelles
est_consonne x = x `elem` consonnes

--f []=[] ; unuseful - conflict with f a = a

f (a:b:c) =
    case trait a b of
        True -> a : (" AV " ++ f (b:c))
        False -> a : f (b:c)
f (a:b) =
    case trait a (head b) of
        True -> a : (" EP " ++ f ( b) )
        False -> a : f ( b)
f a =  a

-- detect a vowel following a consonant
trait a b = est_consonne a && est_voyelle b



f (a:b) is never invoked (i wrote EP instead of AV to trace the 
problem). f(a:b:c) seems to always take precedence over the other patterns.
I expect f(a:b:c) to treat words greater than or equal to 3 letters, 
f(a:b) the last two letters of the word (no third part) and f a the last 
letter.

Another trick : how can i calculate consonnes with a method that makes 
the difference between  the two lists [a..z] and  voyelles, rather  than 
writing each consonant.
As we can append two lists (++), can we compute the difference between 
lists, i.e. delete from the first list the elements that are present in 
the second one ?

Last, with Ghci, is it possible to debug my program, especially for 
recursive functions, because it's hard to follow the successive calls 
and the parameters that are passed each turn.

Greetings,
Didier.

 


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

Message: 7
Date: Sun, 29 Nov 2009 18:45:01 +0100
From: Deniz Dogan <[email protected]>
Subject: Re: [Haskell-beginners] Pattern matching with one, two or
        more    arguments
To: legajid <[email protected]>
Cc: [email protected]
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1

2009/11/29 legajid <[email protected]>:
> Another trick : how can i calculate consonnes with a method that makes the
> difference between  the two lists [a..z] and  voyelles, rather  than writing
> each consonant.
> As we can append two lists (++), can we compute the difference between
> lists, i.e. delete from the first list the elements that are present in the
> second one ?

Use Data.List.\\

['a'..'z'] \\ "aoeui" ==> "bcdfghjklmnpqrstvwxyz"

-- 
Deniz Dogan


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

Message: 8
Date: Sun, 29 Nov 2009 13:13:31 -0500
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] Pattern matching with one, two or
        more    arguments
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

On Sun, Nov 29, 2009 at 06:41:22PM +0100, legajid wrote:
> Hello,
> I'm writing a little word game that consists of the following : between a 
> consonant and a vowel, insert "AV" so "fabien" becomes "fAVabAVien".
>
> When i type : f "fabine", the result is ok ("fAVabAVinAVe")
> When i type : f "fabien", the result is fAVabAVie *** exception :prelude 
> empty list
>
> Here's my program
>
> voyelles="aeiouy"
> consonnes="bcdfghjklmnpqrstvwxz"
>
> est_voyelle x = x `elem` voyelles
> est_consonne x = x `elem` consonnes
>
> --f []=[] ; unuseful - conflict with f a = a
>
>
> -- detect a vowel following a consonant
> trait a b = est_consonne a && est_voyelle b
>
>
>
> f (a:b) is never invoked (i wrote EP instead of AV to trace the problem). 
> f(a:b:c) seems to always take precedence over the other patterns.
> I expect f(a:b:c) to treat words greater than or equal to 3 letters, f(a:b) 
> the last two letters of the word (no third part) and f a the last letter.

This is not correct.  The patern (a:b:c) matches words greater than or
equal to TWO letters, not three.  In the case of a two-letter word, c
is the empty list.  For example, the word "in" is ('i':'n':[]).

> f (a:b:c) =
>    case trait a b of
>        True -> a : (" AV " ++ f (b:c))
>        False -> a : f (b:c)
> f (a:b) =
>    case trait a (head b) of
>        True -> a : (" EP " ++ f ( b) )
>        False -> a : f ( b)
> f a =  a

The problem is with the call to 'head b' -- when f is called on a
one-letter word, it matches the pattern (a:b) with b the empty list,
and the call to 'head' crashes.  You do not need to check the trait in
this case at all.  In fact, you do not need this entire case at all!
Just the first case and the third should suffice.

-Brent


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

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


End of Beginners Digest, Vol 17, Issue 32
*****************************************

Reply via email to