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:  wxHaskell install errors (carlos gomez)
   2. Re:  wxHaskell install errors (Gregory Guthrie)
   3. Re:  wxHaskell install errors (Gregory Guthrie)
   4. Re:  graphics.gloss errors (Chadda? Fouch?)
   5. Re:  wrapping text in a multiline string (Chadda? Fouch?)
   6. Re:  wxHaskell install errors (carlos gomez)
   7. Re:  wrapping text in a multiline string (Rico Moorman)


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

Message: 1
Date: Wed, 6 Jun 2012 12:38:37 -0400
From: carlos gomez <[email protected]>
Subject: Re: [Haskell-beginners] wxHaskell install errors
To: Gregory Guthrie <[email protected]>
Cc: "[email protected]" <[email protected]>
Message-ID:
        <cahg7derurgkleja8yhdgb73nymrpt8c7nvft2u5+brbkeea...@mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"

Is your wx-config working ?
You can try:  *wx-config ?help*

If not, try with another, you can use these ones:

-   download from https://sites.google.com/site/wxconfig/sourcecode
    and compile with g++ wx-config.cpp -o wx-config.exe
-   or download directly the .exe from
http://sourceforge.net/projects/wxhaskell/files/wx-config-win/

Regards,
Carlos Gomez

On 5 June 2012 16:23, Gregory Guthrie <[email protected]> wrote:

> I had all of the wxHaskell programs installed and working fine, but now
> with an update to Haskell Platform and thus also ghci, I need to upgrade
> all of them (the previously working programs fail) requiring an update for
> the underlying wxWidgets from 2.8 to 2.9 versions.
>
> I downloaded and built wxWidgets 2.9, since the current wxHaskell
> libraries require it (I couldn't find any existing binaries online).
> The compile seemed to be successful, but when I then try to use it from
> the wxHaskell programs I get an error that I don't know how to fix:
>
> C: >cabal install wx
> Resolving dependencies...
> [1 of 1] Compiling Main             (
> C:\Users\guthrie\AppData\Local\Temp\wxc-0.
> 90.0.3-7324\wxc-0.90.0.3\Setup.hs,
> C:\Users\guthrie\AppData\Local\Temp\wxc-0.90.
> 0.3-7324\wxc-0.90.0.3\dist\setup\Main.o ) Linking
> C:\Users\guthrie\AppData\Local\Temp\wxc-0.90.0.3-7324\wxc-0.90.0.3\dist\
> setup\setup.exe ...
> Configuring wxc-0.90.0.3...
> Configuring wxc to build against wxWidgets 2.9
>
> setup.exe: Missing dependencies on foreign libraries:
> * Missing C libraries: wxmsw29ud_all, wxtiffd, wxjpegd, wxpngd,
> wxzlibd,wxregexud, wxexpatd, wxregexud 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.90.0.1 depends on wxc-0.90.0.3 which failed to install.
> wxc-0.90.0.3 failed during the configure step. The exception was:
> ExitFailure 1
> wxcore-0.90.0.1 depends on wxc-0.90.0.3 which failed to install.
>
>
> _______________________________________________
> 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/20120606/5f3a5106/attachment-0001.htm>

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

Message: 2
Date: Wed, 6 Jun 2012 11:42:58 -0500
From: Gregory Guthrie <[email protected]>
Subject: Re: [Haskell-beginners] wxHaskell install errors
To: carlos gomez <[email protected]>
Cc: "[email protected]" <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

Thanks, yes - it seems good, it responds with a help menu message.

> Subject: Re: [Haskell-beginners] wxHaskell install errors
> 
> Is your wx-config working ?
> You can try:??wx-config -help?
>
> If not, try with another, you can use these ones:
>
> - ? download from https://sites.google.com/site/wxconfig/sourcecode
>? ? and compile with?g++ wx-config.cpp -o wx-config.exe
>- ? or download directly the .exe from 
>??http://sourceforge.net/projects/wxhaskell/files/wx-config-win/
>? ??
>Regards,
>Carlos Gomez



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

Message: 3
Date: Wed, 6 Jun 2012 11:52:03 -0500
From: Gregory Guthrie <[email protected]>
Subject: Re: [Haskell-beginners] wxHaskell install errors
To: "[email protected]" <[email protected]>
Message-ID:
        <[email protected]>
Content-Type: text/plain; charset="us-ascii"

No, I am not sure of this - I followed the instructions at:
   
http://www.haskell.org/haskellwiki/WxHaskell/Windows#wxWidgets_2.9_and_wxHaskell_0.90.x
  
The describe the "install" as the wxWidgets install of source code, and then 
how to compile it, and then just to do cabal installs, which is what is failing.

The cabal install error describes some configuration options, but I don't know 
where or how they are intended to be used.
     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.

I see in my cabal directory that it has files :
  Wx-0.12.1.6,
  Wxcore-0.12.1.7
  Wxdirect-0.12.1.4
  Wxdirect-0.90.0.1

I also notice that these instructions require a bunch of PATH fiddling that I 
never had to do before for wxWidgets /wxHaskell 2.8. 
Also that it asks to install a path pointer to the cabal directory to 
\wxc-%WXC_VERSION%\%GHC_VERSION% which file does not exist on my system.  ??

> -----Original Message-----
> Subject: Re: [Haskell-beginners] wxHaskell install errors
> To: [email protected]
> > C: >cabal install wx
> > Resolving dependencies...
...
> > setup\setup.exe ...
> > Configuring wxc-0.90.0.3...
> > Configuring wxc to build against wxWidgets 2.9
> >
> > setup.exe: Missing dependencies on foreign libraries:
...
> Are you sure that you installed wxWidgets 2.9 and didn't just compile it from 
> source? It
> looks like cabal can't find the wxWidgets libraries on your system.



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

Message: 4
Date: Wed, 6 Jun 2012 19:34:26 +0200
From: Chadda? Fouch? <[email protected]>
Subject: Re: [Haskell-beginners] graphics.gloss errors
To: Gregory Guthrie <[email protected]>
Cc: "[email protected]" <[email protected]>
Message-ID:
        <CANfjZRY92pmOWtFY+937OB=o2wnbaeyp_2gyg5-+ng0knsa...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Tue, Jun 5, 2012 at 10:36 PM, Gregory Guthrie <[email protected]> wrote:
> Apparently I needed to upgrade my examples, the API seems to have changed 
> across versions.
>

Right, since the fullscreen mode was introduced, the API is "display
displayMode backgroundColor picture" where displayMode is Window or
Fullscreen (with relevant title, size and position details). So :

> display (Window "My Window" (200, 200) (10, 10)) white (Circle 80)

-- 
Jeda?



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

Message: 5
Date: Wed, 6 Jun 2012 19:50:44 +0200
From: Chadda? Fouch? <[email protected]>
Subject: Re: [Haskell-beginners] wrapping text in a multiline string
To: Rico Moorman <[email protected]>
Cc: [email protected]
Message-ID:
        <canfjzryyjwudjvjx_njqk+ffb6npz3avcocc7tgyykftypx...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

On Wed, Jun 6, 2012 at 10:39 AM, Rico Moorman <[email protected]> wrote:
> Now I am wondering how I would integrate this in the replacement
> function or how to rewrite it properly.
>
> Looking at the type signature of =~~ (with my limited knowledge) it
> seems that I would have to "use" RegexMaker adding up the CompOptions
> needed?
>
> (=~~)?:: (RegexMaker?Regex?CompOption?ExecOption?source,?RegexContext
> Regex?source1 target,?Monad?m) => source1 -> source -> m target

What's non-obvious and trip a lot of people when they try to use
regexes in Haskell is that most regex libraries use the same
interface, which is specified in the regex-base and consists of
several typeclasses that offers a very high degree of flexibility.
=~and =~~ are only the simplified front-ends to this and are pretty
inadequate for advanced usages (for instance compile and use multiple
time the same regex, you should really avoid =~ in this case, or
additional regex compilation options). To see the basic interface,
look at Text.Regex.Base.RegexLike :
http://hackage.haskell.org/packages/archive/regex-base/latest/doc/html/Text-Regex-Base-RegexLike.html
.
In particular, what you want to do should be done with makeRegexOpts
and match (or matchM), note that the available compilation and
execution options can vary depending on the regex library you use and
for regex-pcre, they're documented there :
http://hackage.haskell.org/packages/archive/regex-pcre/latest/doc/html/Text-Regex-PCRE-Wrap.html#g:4

-- 
Jeda?



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

Message: 6
Date: Wed, 6 Jun 2012 14:19:18 -0400
From: carlos gomez <[email protected]>
Subject: Re: [Haskell-beginners] wxHaskell install errors
To: Gregory Guthrie <[email protected]>
Cc: "[email protected]" <[email protected]>
Message-ID:
        <CAHg7deSChJmNzGiQZBcVgcKHAYzFVvV+L7RU=eg9qh4d-p0...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

First, you should make sure for yourself that wxWidgets 2.9 is well
installed, for that you can try to build the wxwidgets' examples

cd c:\wx\samples\minimal
mingw32-make -f makefile.gcc BUILD=debug

Then, I can think that it is just a problem of configuring and installing
wxhaskell.

For the paths you have to set, probably the wxc is not installed on your pc
yet, and probably that's why you couldn't find. But you should follow the
way setting those paths and put the right versions of the libraries you are
installing.

Best wishes, Carlos Gomez

On 6 June 2012 12:52, Gregory Guthrie <[email protected]> wrote:

> No, I am not sure of this - I followed the instructions at:
>
> http://www.haskell.org/haskellwiki/WxHaskell/Windows#wxWidgets_2.9_and_wxHaskell_0.90.x
>
> The describe the "install" as the wxWidgets install of source code, and
> then how to compile it, and then just to do cabal installs, which is what
> is failing.
>
> The cabal install error describes some configuration options, but I don't
> know where or how they are intended to be used.
>      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.
>
> I see in my cabal directory that it has files :
>  Wx-0.12.1.6,
>  Wxcore-0.12.1.7
>  Wxdirect-0.12.1.4
>  Wxdirect-0.90.0.1
>
> I also notice that these instructions require a bunch of PATH fiddling
> that I never had to do before for wxWidgets /wxHaskell 2.8.
> Also that it asks to install a path pointer to the cabal directory to
> \wxc-%WXC_VERSION%\%GHC_VERSION% which file does not exist on my system.  ??
>
> > -----Original Message-----
> > Subject: Re: [Haskell-beginners] wxHaskell install errors
> > To: [email protected]
> > > C: >cabal install wx
> > > Resolving dependencies...
> ...
> > > setup\setup.exe ...
> > > Configuring wxc-0.90.0.3...
> > > Configuring wxc to build against wxWidgets 2.9
> > >
> > > setup.exe: Missing dependencies on foreign libraries:
> ...
> > Are you sure that you installed wxWidgets 2.9 and didn't just compile it
> from source? It
> > looks like cabal can't find the wxWidgets libraries on your system.
>
> _______________________________________________
> 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/20120606/54744f95/attachment-0001.htm>

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

Message: 7
Date: Wed, 6 Jun 2012 22:08:27 +0200
From: Rico Moorman <[email protected]>
Subject: Re: [Haskell-beginners] wrapping text in a multiline string
To: Chadda? Fouch? <[email protected]>
Cc: [email protected]
Message-ID:
        <CAJrzcX1c_D9am1-5zTG81nBS1YsL+b1K=hjidj98za5d7da...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

Thank you for this important detail.

Following the advice in this thread I tried to rewrite the function in
terms of the lower-level interface instead of using =~~

-- qualified import to avoid clashes in main program
import qualified Text.Regex.PCRE as RE

regexReplace' :: String -> (String -> String) -> String -> String
regexReplace' regex replace text = go text
    where
        regex' :: RE.Regex
        regex' = RE.makeRegexOpts RE.defaultCompOpt RE.defaultExecOpt regex
        replace' :: RE.MatchText String -> String
        replace' = undefined
        go text = case RE.matchOnceText regex' text of
            Just (before, match, after) ->
                before ++ replace' match ++ go after
            _ -> text

Did you mean something like this? (besides that the replace' function
still has to be filled in)

If this is correct ... I am still a little lost though. I cannot come
up with a way of matching the actual String out of the MatchText
returned by matchOnceText ...
http://hackage.haskell.org/packages/archive/regex-base/latest/doc/html/Text-Regex-Base-RegexLike.html#v:matchOnceText

If I should structure the entire function differently, I would be very
grateful to receive some pointers how.

Best regards,

rico

On Wed, Jun 6, 2012 at 7:50 PM, Chadda? Fouch? <[email protected]> wrote:
> On Wed, Jun 6, 2012 at 10:39 AM, Rico Moorman <[email protected]> wrote:
>> Now I am wondering how I would integrate this in the replacement
>> function or how to rewrite it properly.
>>
>> Looking at the type signature of =~~ (with my limited knowledge) it
>> seems that I would have to "use" RegexMaker adding up the CompOptions
>> needed?
>>
>> (=~~)?:: (RegexMaker?Regex?CompOption?ExecOption?source,?RegexContext
>> Regex?source1 target,?Monad?m) => source1 -> source -> m target
>
> What's non-obvious and trip a lot of people when they try to use
> regexes in Haskell is that most regex libraries use the same
> interface, which is specified in the regex-base and consists of
> several typeclasses that offers a very high degree of flexibility.
> =~and =~~ are only the simplified front-ends to this and are pretty
> inadequate for advanced usages (for instance compile and use multiple
> time the same regex, you should really avoid =~ in this case, or
> additional regex compilation options). To see the basic interface,
> look at Text.Regex.Base.RegexLike :
> http://hackage.haskell.org/packages/archive/regex-base/latest/doc/html/Text-Regex-Base-RegexLike.html
> .
> In particular, what you want to do should be done with makeRegexOpts
> and match (or matchM), note that the available compilation and
> execution options can vary depending on the regex library you use and
> for regex-pcre, they're documented there :
> http://hackage.haskell.org/packages/archive/regex-pcre/latest/doc/html/Text-Regex-PCRE-Wrap.html#g:4
>
> --
> Jeda?



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

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


End of Beginners Digest, Vol 48, Issue 10
*****************************************

Reply via email to