http://en.pk.paraiso-lang.org/Haskell/Monad-Gaussian
What do you think? Will this be a good approach or bad?
I don't think it is a Monad (or even restricted monad, see
below). Suppose G a is a `Gaussian' monad and n :: G Double is a
random number with the Gaussian (Normal distribution). Then
On Wed, Jul 18, 2012 at 05:51:51PM -0600, Richard G. wrote:
What's the best way to fix this? I can see two options:
- Move the test stanzas to a different Cabal file, allowing users to
perform the tests with a little fiddling.
- Remove the conditional statements from the test stanzas, which
Exercise: how does the approach in the code relate to the approaches
to sharing explained in
http://okmij.org/ftp/tagless-final/sharing/sharing.html
Chapter 3 introduces an implicit impure counter, and Chapter 4 uses a
database that is passed around.
let_ in Chapter 5 of
On Wed, Jul 18, 2012 at 09:35:52AM +0100, Erik Hesselink wrote:
I don't think you can install this package on 7.4. As Andres said, it
requires containers 0.5, but ghc 7.4's base libraries (in this case,
template-haskell) use containers 0.4, and can't be reinstalled. I
guess your best bet is to
Dear gentle Haskellers,
I was trying to whet my Haskell by trying out Parsec today to try and parse
out XML. Here's the code I cam up with -
I wanted some help with the gettext parser that I've written. I had to do
a dummy char ' ') in there just to satisfy the many used in the xml
parser. I'd
Am 19.07.2012 14:53, schrieb C K Kashyap:
Dear gentle Haskellers,
I was trying to whet my Haskell by trying out Parsec today to try and
parse out XML. Here's the code I cam up with -
I wanted some help with the gettext parser that I've written. I had to
do a dummy char ' ') in there just to
Am 19.07.2012 14:53, schrieb C K Kashyap:
innerXML = do
x - (try xml | gettext)
return x
Omit try (and return).
xml always starts with whereas gettext never does.
C.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
gettext = (many1 $ noneOf ) = (return . Body)
works for your case.
On Thu, Jul 19, 2012 at 6:37 PM, Christian Maeder
christian.mae...@dfki.dewrote:
Am 19.07.2012 14:53, schrieb C K Kashyap:
Dear gentle Haskellers,
I was trying to whet my Haskell by trying out Parsec today to try and
Am 19.07.2012 15:14, schrieb Christian Maeder:
Am 19.07.2012 14:53, schrieb C K Kashyap:
innerXML = do
x - (try xml | gettext)
return x
Omit try (and return).
xml always starts with whereas gettext never does.
I was wrong, you do not want to swallow an endTag as
On Thu, Jul 19, 2012 at 06:45:05PM +0530, Sai Hemanth K wrote:
gettext = (many1 $ noneOf ) = (return . Body)
You can simplify this to:
import Control.Applicative hiding ((|))
gettext = Body $ many1 (noneOf )
And some of your other parsers can be simplified as well:
innerXML =
gettext = Body $ many1 (noneOf )
Note that this is the same as:
gettext = Body `fmap` many1 (noneOf )
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On Thu, Jul 19, 2012 at 03:34:47PM +0200, Simon Hengel wrote:
openTag :: Parser String
openTag = char '' * many (noneOf ) * char ''
endTag :: String - Parser String
endTag str = string / * string str * char ''
Well yes, modified to what Christian Maeder just suggested.
Am 19.07.2012 15:26, schrieb Christian Maeder:
Am 19.07.2012 15:14, schrieb Christian Maeder:
Am 19.07.2012 14:53, schrieb C K Kashyap:
innerXML = do
x - (try xml | gettext)
return x
Omit try (and return).
xml always starts with whereas gettext never does.
I was wrong,
On Thu, Jul 19, 2012 at 09:37:52AM +0800, Magicloud Magiclouds wrote:
Hi,
Say I have a package that only appends
--constraint=template-haskell==2.7.0.0
--constraint=warp-tls==1.2.1 could I install it. Now I want to
release the package, then how could I have these constraint into the
.cabal
Am 19.07.2012 15:41, schrieb Simon Hengel:
On Thu, Jul 19, 2012 at 03:34:47PM +0200, Simon Hengel wrote:
openTag :: Parser String
openTag = char '' * many (noneOf ) * char ''
if you disallow empty tags and / within tags, then you can avoid the
notFollowedBy construct by:
Thank you so much ... I've updated my monad version here -
https://github.com/ckkashyap/LearningPrograms/blob/master/Haskell/Parsing/xml_1.hshttps://github.com/ckkashyap/LearningPrograms/blob/master/Haskell/Parsing/xml_2.hs
and the Applicative version here -
16 matches
Mail list logo