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: GHC7.4.1 -> LLVM ->W64 (Brandon Allbery)
2. wxHaskell path (Henry Lockyer)
3. Re: GHC7.4.1 -> LLVM ->W64 (Alexander.Vladislav.Popov )
4. wrapping text in a multiline string (Rico Moorman)
5. Re: wrapping text in a multiline string (Arlen Cuss)
6. flatten comma operator (Kees Bleijenberg)
7. Re: flatten comma operator (Arlen Cuss)
----------------------------------------------------------------------
Message: 1
Date: Tue, 5 Jun 2012 18:36:41 -0400
From: Brandon Allbery <[email protected]>
Subject: Re: [Haskell-beginners] GHC7.4.1 -> LLVM ->W64
To: Antoine Latter <[email protected]>
Cc: [email protected], beginners
<[email protected]>
Message-ID:
<CAKFCL4VxhEN-bA-ts-y7AH0ZTJRJwn=8KTT=+ekg4a57vra...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Tue, Jun 5, 2012 at 8:02 AM, Antoine Latter <[email protected]> wrote:
> I know that folks were spending time on making GHC work for Win-64,
> but I don't remember if it has shipped.
>
Scheduled for GHC 7.6.1
--
brandon s allbery [email protected]
wandering unix systems administrator (available) (412) 475-9364 vm/sms
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20120605/0fc2842a/attachment-0001.htm>
------------------------------
Message: 2
Date: Wed, 6 Jun 2012 00:39:44 +0100
From: Henry Lockyer <[email protected]>
Subject: [Haskell-beginners] wxHaskell path
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
Hi all
Trying to work out how to get wxHaskell correctly installed on mac os x (10.6.8
snow leopard).
Have decided to try and get the older version working (0.13) so as to use the
pre-installed
wxWidgets (2.8.8 it seems). I was looking at the wxHAskell install info for
mac os x at
(1) http://www.haskell.org/haskellwiki/WxHaskell/MacOS_X - which only talks
about widgets 2.9,
but I have now been reading
(2) http://www.haskell.org/haskellwiki/WxHaskell/2.8
Question:
The variable "$wxwin" is referred to in the page at link (2) above, where it
says:
"We assume in this guide that the variable $wxwin points to your wxWidgets
installation directory, for example: ~/dev/wxGTK-2.8.10."
And in the page at link (1), step 3, it says:
"Check your path to make sure you are using your wxWidgets and not the default
Mac one"
Are these referring to the same thing? ( I had originally interpreted 'path'
as referring to $PATH.)
The reference to $wxwin is in instructions for building wxWidgets 2.8 which I
should not need to do if I am
using the already installed 2.8.8 widgets library, but if I echo $wxwin it is
blank and does not therefore appear to
point to my wxWidgets installation directory.
Is this an issue or is it only relevant to the initial build process for
wxWidgets?
Can anyone throw any light on this?
Thanks/ Henry
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20120606/9c55d690/attachment-0001.htm>
------------------------------
Message: 3
Date: Wed, 6 Jun 2012 11:00:38 +0600
From: "Alexander.Vladislav.Popov "
<[email protected]>
Subject: Re: [Haskell-beginners] GHC7.4.1 -> LLVM ->W64
To: Brandon Allbery <[email protected]>
Cc: beginners <[email protected]>
Message-ID:
<calpbq9bhxoy9spjuxzr6hcdvm1bwd2xiyxn0z+fpgaytr8h...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
It's very pity.
Thank you very much indeed, dear haskellers.
2012/6/6 Brandon Allbery <[email protected]>
> On Tue, Jun 5, 2012 at 8:02 AM, Antoine Latter <[email protected]> wrote:
>
>> I know that folks were spending time on making GHC work for Win-64,
>> but I don't remember if it has shipped.
>>
>
> Scheduled for GHC 7.6.1
>
> --
> brandon s allbery [email protected]
> wandering unix systems administrator (available) (412) 475-9364 vm/sms
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20120606/2ae2bf9e/attachment-0001.htm>
------------------------------
Message: 4
Date: Wed, 6 Jun 2012 07:05:22 +0200
From: Rico Moorman <[email protected]>
Subject: [Haskell-beginners] wrapping text in a multiline string
To: [email protected]
Message-ID:
<cajrzcx17g1h2rw8ovxkjiy3eu1kx8wrtmc2inhkvi2e_vnm...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
Hello,
I have a given piece of multiline HTML (which is generated using pandoc
btw.) and I am trying to wrap certain elements (tags with a given class)
with a <div>.
I already took a look at the Text.Regex.PCRE module which seemed a
reasonable choice because I am already familiar with similar regex
implementations in other languages.
I came up with the following function which takes a regex and replaces all
matches within the given string using the provided function (which I would
use to wrap the element)
import Text.Regex.PCRE ((=~~))
-- Replaces the whole match for the given regex using the given function
regexReplace :: String -> (String -> String) -> String -> String
regexReplace regex replace text = go text
where
go text = case text =~~ regex of
Just (before, match, after) ->
before ++ replace match ++ go after
_ -> text
The problem with this function is, that it will not work on multiline
strings. I would like to call it like this:
newBody = regexReplace "<table class=\"sourceCode\".*?table>" wrap body
wrap x = "<div class=\"sourceCodeWrap\">" ++ x ++ "</div>"
Is there any way to easily pass some kind of multiline modifier to the
regex in question?
Or is this approach completely off and would something else be more
appropriate/haskelly for the problem at hand?
Thank you very much in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20120606/c59140c9/attachment-0001.htm>
------------------------------
Message: 5
Date: Wed, 6 Jun 2012 15:11:31 +1000
From: Arlen Cuss <[email protected]>
Subject: Re: [Haskell-beginners] wrapping text in a multiline string
To: Rico Moorman <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
I'd be more inclined to look at a solution involving manipulating the HTML
structure, rather than trying a regexp-based approach, which will probably end
up disappointing. (See this: http://stackoverflow.com/a/1732454/499609)
I hope another Haskeller can speak to a library that would be good for this
kind of purpose.
To suit what you're doing now, though; if you change .*? to [\s\S]*?, it should
work on multiline strings. If you can work out how to pass the 's' modifier to
Text.Regexp.PCRE, that should also do it.
?Arlen
On Wednesday, 6 June 2012 at 3:05 PM, Rico Moorman wrote:
> Hello,
>
> I have a given piece of multiline HTML (which is generated using pandoc btw.)
> and I am trying to wrap certain elements (tags with a given class) with a
> <div>.
>
> I already took a look at the Text.Regex.PCRE module which seemed a reasonable
> choice because I am already familiar with similar regex implementations in
> other languages.
>
> I came up with the following function which takes a regex and replaces all
> matches within the given string using the provided function (which I would
> use to wrap the element)
>
> import Text.Regex.PCRE ((=~~))
>
> -- Replaces the whole match for the given regex using the given function
> regexReplace :: String -> (String -> String) -> String -> String
> regexReplace regex replace text = go text
> where
> go text = case text =~~ regex of
> Just (before, match, after) ->
> before ++ replace match ++ go after
> _ -> text
>
> The problem with this function is, that it will not work on multiline
> strings. I would like to call it like this:
>
> newBody = regexReplace "<table class=\"sourceCode\".*?table>" wrap body
> wrap x = "<div class=\"sourceCodeWrap\">" ++ x ++ "</div>"
>
> Is there any way to easily pass some kind of multiline modifier to the regex
> in question?
>
> Or is this approach completely off and would something else be more
> appropriate/haskelly for the problem at hand?
>
> Thank you very much in advance.
> _______________________________________________
> Beginners mailing list
> [email protected] (mailto:[email protected])
> http://www.haskell.org/mailman/listinfo/beginners
------------------------------
Message: 6
Date: Wed, 6 Jun 2012 08:33:24 +0200
From: "Kees Bleijenberg" <[email protected]>
Subject: [Haskell-beginners] flatten comma operator
To: <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
In 'Real World Haskell' I found code like LiftA2 (,) ....
Looks odd. But after some experimenting in winghci I found that (,) 1 2 is
valid code and is equal to (1,2).
Now I wonder how to create (1,2,3). I think you need a join or a flatten
function or ...? Join doesn't work?
Kees
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20120606/d3d85468/attachment-0001.htm>
------------------------------
Message: 7
Date: Wed, 6 Jun 2012 16:36:28 +1000
From: Arlen Cuss <[email protected]>
Subject: Re: [Haskell-beginners] flatten comma operator
To: Kees Bleijenberg <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
If (,) is a function that takes two elements and returns the 2-tuple, have you
considered something like (,,)? :)
On Wednesday, 6 June 2012 at 4:33 PM, Kees Bleijenberg wrote:
> In 'Real World Haskell' I found code like LiftA2 (,) ....
> Looks odd. But after some experimenting in winghci I found that (,) 1 2 is
> valid code and is equal to (1,2).
> Now I wonder how to create (1,2,3). I think you need a join or a flatten
> function or ...? Join doesn't work?
>
> Kees
>
> _______________________________________________
> Beginners mailing list
> [email protected] (mailto:[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 48, Issue 6
****************************************