On Mon, Jun 8, 2009 at 10:18 PM, Iavor Diatchki wrote:
>
> OK, I think that I found and fixed the problem. As Thomas pointed
> out, the configure script is not wrong. The problem turned out to be
> the foreign import for "getnameinfo" (this was the missing symbol).
>
So it was the name mangling
haonan21 wrote:
I'm very new to haskell hugs and would appreciate it if someone could help me
out here. I've been giving 2 questions.
1.) A and B are two sets of integers. Implement a function to obtain the
integers that belong to both sets.
Test your function fully.
2.) Define and test a fun
I'm very new to haskell hugs and would appreciate it if someone could help me
out here. I've been giving 2 questions.
1.) A and B are two sets of integers. Implement a function to obtain the
integers that belong to both sets.
Test your function fully.
2.) Define and test a function f, which, if
Paul L wrote in article
<856033f20906082224s2b7d5391gdc7a4ed913004...@mail.gmail.com> in
gmane.comp.lang.haskell.cafe:
> The open question is whether there exists such a
> solution that's both elegant and efficient at maintain proper sharing
> in the object language.
What is your criterion for
Thanks. It seems my original parser also works against FOO,BAR,BAZ if
you only modify
atom = string ","
<|> ( many1 $ noneOf "()<>," ) -- add ,
Indeed, what to call the "thingies" in a parser is a source of some
personal consternation.
What is a token, what is an atom, what is an expr
Hi,
you may also want to look at:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/xml
It knows about namespaces and, also, it's parser is lazy.
-Iavor
On Mon, Jun 8, 2009 at 11:39 AM, John Millikin wrote:
> I'm trying to convert an XML document, incrementally, into a sequence
> of XML
Dear all,
This post is partly a gripe about how poor the formal documentation
for various GHC extensions is, partly a gripe about how GHC blurs the
lines between syntactic and type-level issues as well as between
various extensions, and partly a gripe about how the Haskell 98 report
is sometimes s
On Tue, Jun 9, 2009 at 7:21 AM, Neil Brown wrote:
> data Page a =
> Page {pageName :: IORef String
> ,pageId :: Int
> ,pageBuffer :: a
> ,pageBox :: VBox
> }
>
> class PageBuffer a where
> pageBufferClone :: a -> IO (a, VBox)
>
> pageClone :: Page
2009/6/9 Krzysztof Skrzętnicki
> On Tue, Jun 9, 2009 at 16:14, Daniel Fischer
> wrote:
> > If you're doing much with random generators, wrap it in a State monad.
>
> To avoid reinventing the wheel one can use excellent package available
> on Hackage:
> http://hackage.haskell.org/cgi-bin/hackage-s
Am Dienstag 09 Juni 2009 20:29:09 schrieb Thomas Hartman:
> All I want to do is split on commas, but not the commas inside () or <>
> tags.
>
> I have been wanting to master parsec for a long time and this simple
> exercise looked like a good place to start.
>
> The code below does the right thing.
Bulat Ziganshin wrote:
Hello jerzy,
Tuesday, June 9, 2009, 8:23:04 PM, you wrote:
Please, tell him first about random streams, which he can handle without
IO. Or, about ergodic functions (hashing contraptions which transform ANY
parameter into something unrecognizable). When he says : "I kn
2009/6/6 Bertram Felgenhauer :
> Interesting. This was changed in response to
>
> http://hackage.haskell.org/trac/ghc/ticket/2528
>
> | Tue Sep 2 11:29:50 CEST 2008 Simon Marlow
> | * #2528: reverse the order of args to (==) in nubBy to match nub
> | This only makes a difference when the
All I want to do is split on commas, but not the commas inside () or <> tags.
I have been wanting to master parsec for a long time and this simple
exercise looked like a good place to start.
The code below does the right thing. Am I missing any tricks to make
this simpler/neater?
Thanks, thomas.
Hello jerzy,
Tuesday, June 9, 2009, 8:23:04 PM, you wrote:
> Please, tell him first about random streams, which he can handle without
> IO. Or, about ergodic functions (hashing contraptions which transform ANY
> parameter into something unrecognizable). When he says : "I know all that",
> THEN hu
Magnus Therning writes:
ptrash wrote:
...am not getting through it. I just want to generate a random number
and then compare it with other numbers. Something like
r = randomRIO (1, 10)
if (r > 5) then... else ...
You have to do it inside the IO monad, something like
myFunc = do
On Tue, Jun 9, 2009 at 16:14, Daniel Fischer wrote:
> Am Dienstag 09 Juni 2009 15:57:24 schrieb Magnus Therning:
>> On Tue, Jun 9, 2009 at 2:52 PM, ptrash wrote:
>> > Hmm...it am not getting through it. I just want to generate a random
>> > number and then compare it with other numbers. Something l
Hi all,
I have below source code, i use Dynamic for `pageBuffer`.
In implement of function `pageClone`, after `case pt of`, i need write
like this, and this code looks ugly, if `PageTyep` have 100 type, i need
write those ugly code 100 times.
case pt of
TStringBuffer ->
Andy Stewart wrote:
So have a better solution to avoid write above ugly code
How about:
data Page a =
Page {pageName :: IORef String
,pageId:: Int
,pageBuffer:: a
,pageBox :: VBox
}
class PageBuffer a where
pageBufferClone :: a ->
In the import statements, it wasn't clear to me that I could import types as
well as functions, and Map is a type. All clear now.
Thanks.
Michael
--- On Tue, 6/9/09, Thomas ten Cate wrote:
From: Thomas ten Cate
Subject: Re: [Haskell-cafe] Applying Data.Map
To: "michael rice"
Cc: haskell-caf
John Millikin wrote:
On Mon, Jun 8, 2009 at 3:39 PM, Henning
Thielemann wrote:
I think you could use the parser as it is and do the name parsing later.
Due to lazy evaluation both parsers would run in an interleaved way.
I've been trying to figure out how to get this to work with lazy
evaluati
Am Dienstag 09 Juni 2009 15:57:24 schrieb Magnus Therning:
> On Tue, Jun 9, 2009 at 2:52 PM, ptrash wrote:
> > Hmm...it am not getting through it. I just want to generate a random
> > number and then compare it with other numbers. Something like
> >
> > r = randomRIO (1, 10)
> > if (r > 5) then...
On Tue, 9 Jun 2009, ptrash wrote:
I am using the System.Random method randomRIO. How can I convert its output
to an Int?
in general:
http://haskell.org/haskellwiki/How_to_get_rid_of_IO
about randomIO:
http://haskell.org/haskellwiki/Avoiding_IO#State_monad
On Tue, Jun 9, 2009 at 2:52 PM, ptrash wrote:
>
> Hmm...it am not getting through it. I just want to generate a random number
> and then compare it with other numbers. Something like
>
> r = randomRIO (1, 10)
> if (r > 5) then... else ...
You have to do it inside the IO monad, something like
Hmm...it am not getting through it. I just want to generate a random number
and then compare it with other numbers. Something like
r = randomRIO (1, 10)
if (r > 5) then... else ...
--
View this message in context:
http://www.nabble.com/Convert-IO-Int-to-Int-tp23940249p23943301.html
Sent from th
On Tue, Jun 9, 2009 at 15:23, michael rice wrote:
> import Data.Map (Map) (fromList,!) ???
> import qualified Data.Map as Map (fromList,!) ???
Because ! is an operator, you need to enclose it in parentheses. Also,
the (Map) in the import is already the list of things you are
importing; you can
On Tue, 2009-06-09 at 06:05 -0700, ptrash wrote:
> Hi,
>
> I have the following two lists:
>
> a = [1,2,3]
> b = ["A","B","C"]
>
> I want a combination of the to lists:
>
> c = [(1,"A"), (2, "B"), (3, "C")]
>
> How can I do this?
What you want is a function with the following type signature:
Hi Toby,
Thanks for the helpful comments. I'd gotten used to arithmetic operator
sections (+2), (*2), etc. but hadn't picked up on the generality of using them
with *any* infix function. I can also see the benefit of using List.Group.
However, I'm uncertain about how to import just fromList and
Hey, cool. Thanks!
--
View this message in context:
http://www.nabble.com/Combine-to-List-to-a-new-List-tp23942440p23942633.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskel
Probably you might need the "zip" function.Check
here:http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:zip
> Date: Tue, 9 Jun 2009 06:05:57 -0700
> From: ptr...@web.de
> To: haskell-cafe@haskell.org
> Subject: [Haskell-cafe] Combine to List to a new List
>
>
> Hi,
>
> I h
Try c = zip a b
On Tue, Jun 9, 2009 at 9:05 AM, ptrash wrote:
>
> Hi,
>
> I have the following two lists:
>
> a = [1,2,3]
> b = ["A","B","C"]
>
> I want a combination of the to lists:
>
> c = [(1,"A"), (2, "B"), (3, "C")]
>
> How can I do this?
>
> I have tried
>
> c = [(x,y) | x <- a, y <- b]
>
Hi,
I have the following two lists:
a = [1,2,3]
b = ["A","B","C"]
I want a combination of the to lists:
c = [(1,"A"), (2, "B"), (3, "C")]
How can I do this?
I have tried
c = [(x,y) | x <- a, y <- b]
But this just returns me a list with every possible combination of the 2
lists.
Thanks..
Ok, thanks for the information.
--
View this message in context:
http://www.nabble.com/Convert-IO-Int-to-Int-tp23940249p23942344.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
___
Haskell-Cafe mailing list
Haskell-Cafe@h
Sterling Clover gmail.com> writes:
>
> Try it with the following type signature and it should work fine:
>
> convert :: (Data a) => Int -> a -> a
>
> Of course, as has been noted, SYB is a rather big sledgehammer for
> the insect in question.
>
> Cheers,
> S.
>
Thank you Sterling. That
One more example:
This does not type-check:
---
{-# LANGUAGE RankNTypes, ImpredicativeTypes #-}
f :: [forall a. t a -> t a] -> t b -> t b
f = foldr (.) id
---
Couldn't match expected type
On 2009/06/09, at 19:33, Tobias Olausson wrote:
You can not convert an IO Int to Int, or at least, you shouldn't.
However, you can do as follows:
test :: IO ()
test = do
int <- randomRIO -- or whatever it is called
print $ useInt int
useInt :: Int -> Int
useInt x = x+10
Or, you can li
ptrash wrote:
> Hi,
>
> I am using the System.Random method randomRIO. How can I convert its output
> to an Int?
>
> Thanks...
You cannot [1], you should read up on monads and I/O in Haskell, for example
http://haskell.org/haskellwiki/IO_inside
[1] Yes, you can, but no, you don't want to.
Rega
You can not convert an IO Int to Int, or at least, you shouldn't.
However, you can do as follows:
test :: IO ()
test = do
int <- randomRIO -- or whatever it is called
print $ useInt int
useInt :: Int -> Int
useInt x = x+10
//Tobias
2009/6/9 ptrash :
>
> Hi,
>
> I am using the System.Rando
Hi,
I am using the System.Random method randomRIO. How can I convert its output
to an Int?
Thanks...
--
View this message in context:
http://www.nabble.com/Convert-IO-Int-to-Int-tp23940249p23940249.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
_
Hi,
I have the following code:
---
{-# LANGUAGE RankNTypes #-}
f :: ((forall a. a -> a) -> b) -> b
f x = x id
g :: (forall c. Eq c => [c] -> [c]) -> ([Bool],[Int])
g y = (y [True], y [1])
h :: ([Bool],[Int])
h = f g
---
And just to provide an example of working program:
---
module Main where
import Text.XML.Expat.Qualified
import Text.XML.Expat.Namespaced
import Text.XML.Expat.Tree
import qualified Data.ByteString.Lazy as BSL
main = do
f <- BSL.readFile "doc1.xml"
let (tree,error) = parseTree N
Hi everyone,
Tonight there will be another meeting of the Dutch Haskell Users'
Group! This time we'll meet in Amsterdam, in the library. On the wiki
[1] you can find the details of how to reach it. We'll be at the top
floor and shouldn't be hard to recognize. The meeting is set to begin
a
On Mon, Jun 8, 2009 at 20:39, John Millikin wrote:
> I'm trying to convert an XML document, incrementally, into a sequence
> of XML events. A simple example XML document:
>
>
> Doc title
> abc1234
> http://www.w3.org/1999/xhtml";>Hello world!
>
>
> The document can be very large, and arr
Henk-Jan van Tuyl wrote:
> I tried to compile base-4.0.0.0 (on Windows XP) as follows:
> [...]\base\4.0.0.0>runhaskell Setup configure
> : module `Prelude' is not loaded
> It seems that Base needs another way to compile, how?
>
AFAIK base is shipped with GHC, and cannot be compiled separately
Erik de Castro Lopo writes:
> Finally, if a package is deprecated it might be usefult to have
> a reason as well so the hackage entry might say:
>
>Deprecated : true (replaced by package XXX)
>
> or
>
>Deprecated : true (needs maintainer)
Or just Deprecated: (reason)?. Couldn't the p
44 matches
Mail list logo