ul of things that are unfamiliar (type classes, defaulting, tricky
numeric literals), while doing the most basic things (arithmetic). Don't
despair; it'll make sense soon if it doesn't yet.
Regards,
John Dorsey
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Casey,
> Why in a pattern match like
>
> score (1 3) = 7
You probably mean
> score 1 3 = 7
which applies the function 'score' to two arguments. With the parentheses,
it looks like an application of '1' to the argument '3'. But to answer your
actual question...
> can I not have
>
> sizeMax =
> I am trying to use NetSnmp to get some information from my switch.
> And I met this problem.
> After initialize, I used snmpWalk to get some information, and
> dealed with it. Everything is fine. Then I sleep for 5 mins. SnmpWalk
> again. But this time, all asnValues were unsupported format,
> lambdabot is currently hosted on the lowest end linode. The biggest hurdle I
[...]
+1. I use linode for (most of) my Haskell work.
John
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Andrew Coppin said:
>> Sure. But what is a computer program?
then Richard O'Keefe said:
> A computer program, in short, is *whatever we want it to be*.
> (Within reasonable limits.)
I agree with Richard's conclusion.
>From where I sit, the critical point is that, unless you're breadboarding,
pr
> Well, try this: Go ask a random person how you add up a list of numbers.
> Most of them will say something about adding the first two together,
> adding the third to that total, and so forth. In other words, the step
> by step instructions.
You word the (hypothetical) question with a bias
> perimeter :: Geometry -> Double
> perimeter (Sphere _ r) = 0.0
> perimeter (Circle _ r) = 2.0 * pi * r
>
> The latter is even simpler because there is no need in extraction of Double
> value from Maybe.
I'd strongly advise against this last one on style grounds. (0 :: Double)
isn't nearly as s
> >> I'm trying to find the API documentation for happstack 0.3
> >> (online is for 0.2).
[...]
> Max> In most cases it is installed in
> Max> ~/.cabal/share/doc/happstack*/html. Is there any files at
> Max> that directory?
>
> There are now, but only a very few. And very litt
Cale et al,
I have a concern about the implementation of the proposed
TypeDirectedNameResolution. (I'm not familiar with the internals of any of
the compilers, so it could be that my concern isn't well founded.)
I'm assuming that name resolution is currently independent of type
inference, and wi
John,
> Is it possible to create a circular pure data structure in Haskell? For
> example:
Creating the data structure is easy; as other respondents have pointed out.
A simple example is this...
ones = 1 : ones
ones' = 1 : ones'
Comparing these values is harder. All of (ones), (ones'), (tail
> I like the "expected/inferred" vocabulary. Maybe it comes from being a
> native English speaker, but to me, it says "this is what we expected
> to get, but instead (through type inference), we got this type for
> this term".
As another native English speaker, I found "expected/inferred" very
int
Richard,
> I added some partial bindings for libguestfs[1] here:
> http://git.et.redhat.com/?p=libguestfs.git;a=blob;f=haskell/Guestfs.hs;hb=HEAD
Terrific! Partial bindings are great. Thanks for releasing it. I haven't
taken the time to look at your code, but...
> BTW, I found the documentati
> > Does that also mean that you could write:
> >
> > if 3 - 4 then ... else ... (= if (fromInteger 3 :: Bool) - (fromInteger 4
> > :: Bool) then ... else ...)
>
> No. 3 - 4 is an Integer, the proposal is to convert Bools to Ints, not
> Ints to Bools.
Rather, (3 - 4) is a "(Num t) => t", so yes,
Paul,
> There's nothing better than making a data type an instance of Num. In
> particular, fromInteger is a joy. But how about lists?
Do you mean something like Blargh below, only useful?
John
dor...@elwood:~/src/scratch$ cat list.hs
class Blargh f where
fromList :: [a] -> f a
data Foo a
Michael,
> I had a count function that worked fine for an enum type, but thought
> why not go polymorphic with it. So I changed it and got the error I
> originally inquired about.
For variety, I'll go a slightly different direction.
If you generalize count to use any predicate, instead of always
Michael,
> What do I need to add to this Color enum type to print a list of them?
You can also easily print a list of /all/ of them.
Regards,
John
scratch$ cat color.hs
data Color
= Red
| Blue
| Green
| Yellow
| Orange
| Brown
| White
| Black
deriving (Show,E
Edward,
Thanks for straightening me out; I see the problems better now. In
particular I was missing:
1) Orphaned types (and related design issues) get in the way of
splitting the package.
2) Viral dependencies work in two directions, since "upstream" packages
must pick up your deps to
John Lato wrote:
> I think that the proper solution is to break up libraries into
> separate packages as Jeff suggests (buster, buster-ui, etc.), but then
> the total packages on hackage would explode. I don't feel great about
I thought about this a while back and came to the conclusion that the
Quoth FFT:
> My general null hypothesis is, as Alec Baldwin put it, that a loser is
> a loser, or a buggy project is buggy.
I can't see the world in such black and white terms. GHC has strengths
and weaknesses, as do other projects. GHC is changing over time, as are
other projects.
Formally ver
FFT,
> I'm still learning Haskell and also evaluating whether I want to use
> the language in my work.
I've been learning and using GHC in spare hours for several years. I've
had challenges installing it on MacOSX-ppc, and on RHEL4; kind folks on
irc and the mailing lists have always been very h
Rafael Cunha de Almeida wrote:
> This e-mail is offtopic, but I suppose being a little offtopic every now
> and then isn't that bad, specially if the subject is interesting. So,
> here I go.
It's the cafe'. Very little is strictly off-topic here, and certainly
not this.
I'm happy to help anyone
Anonymous One,
> I'm new to haskell, I'm wondering how can you write a function that will do
> the following:
> fromIntToString :: Int -> String
Is this a homework assignment, perchance? Please take a look at
http://www.haskell.org/haskellwiki/Homework_help
Everyone here is glad to help, but we'
Adrian,
> That's why I said "for appropriate g and f". But I see that my
> wording was misleading.
Thanks for following up! I had thought you were arguing that foldl and
foldr were easily and intuitively interchangeable; they're surely not so
for beginners.
Now I think you're arguing that giv
Vasili,
> Are there Haskell users in the Houston area?
At least one, but I'm behind on my cafe' reading.
Cheers,
John
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Quoth Miguel Mitrofanov:
> You have to be unnecessarily strict to read the whole word "Haskell"
> and not just first one or two letters.
Not true, if you're looking forward to what may follow "Haskell".
Cheers,
John
___
Haskell-Cafe mailing list
Hask
em that
> there will never be a crash, though.. The robustness claim is
> strong enough without embellishment.
Pure, total Haskell programs may blow the stack.
Just what is the concise, compelling, unembellished claim regarding
Haskell
Jules Bean wrote:
> I'm saying that we can change programs, and that changes their
> denotation, and that's fine, and anyone can do that. But the denotation
> of a program is supposed to be something independent of a particular
> compiler or OS or MAC address or RAM size or any of the millions
> dmehrtash:
> >What is the difference between empty list [] and list with one unit
> >element [()]?
>
> Prelude> length []
> 0
> Prelude> length [()]
> 1
Also, they differ in type.
[()] is a list of unit elements, and happens to contain exactly one
of them.
[] is a (pol
ypes, permitting the singleton.
minh thu writes:
> I thought to this idea in another way : parenthesis could be used for
> s-expressions and [unicode 0x27e8 and 0x27e0] could be used for
> regular grouping. This would allow to switch in the same code between
> infix and s-expr (e.g. enabling SXM
.
Contributions are welcome. The project could use a tutorial, and a
decent test suite. Strict singleton tuples are planned for the next
version.
Enjoy!
Regards,
John Dorsey
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org
Tim,
> > A year or two ago, ISTR that *most* of the newbie-generated traffic in
> > the cafe was about atrocious performance of naive programs due to
> > strict/lazy concerns. I think it was scaring people away.
>
> I think it's debatable what the various causality relationships might be here
Tim Chevalier wrote:
> I'm no master, but I've never encountered a situation where strictness
> annotations would be useful as documentation, nor can I imagine one.
> That's because optimization *is* the only reason why programmers
> should care about strictness information. IMO, arguing that
> pro
t; executed at most once. Again, I suppose that this is the case while I cannot
> find a guarantee for it.
I'd be surprised if an implementation didn't have that behavior.
I'd also be wary of anyone claiming to guarantee it, beyond compiler X
version Y.
John Dorsey
___
-installed it. How does cabal verify the prerequisite alex
version? (Or does it?)
I'm enjoying cabal since I've begun using it, but it's still somewhat
opaque to me.
Regards,
John Dorsey
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Jeroen,
> isPrime :: Int -> Bool
> isPrime x = isPrime' x primes
> where isPrime' x (p:ps) | x == p = True
> | x > p = isPrime' x ps
> | otherwise = False
>
> main = print $ length (filter (== True) (map isPrime [1..5000]))
[...]
> isPri
I meant to send this reply to the cafe.
- Forwarded message -
Date: Mon, 7 Apr 2008 15:05:00 -0400
To: PR Stanley <[EMAIL PROTECTED]>
Subject: Re: [Haskell-cafe] deriving
Paul,
> No, sorry. I'm not sure how this differs from my definition.
> Could you elaborate please?
Gladly.
Paul,
> Hi
> data Bool = False | True
> deriving (Eq, Or, Show, Read)
>
> Bool is an instance of Eq, Ord, Show and Read. It is derived form
> these classes.
No. "deriving ..." here does not mean that Bool is derived from those
classes; it's not a statement about inheritance or anything simil
Judah,
Thanks for your reply, and your help.
> > (Although it looks like the libraries/readline/configure script
> > might recognize these, I can't get an option to pass through.)
>
> Actually, this is supposed to work. When running the top-level ghc
> configure, you should be a
(Moving to the cafe)
On a related topic, I've been trying to build 6.8.2 on Leopard lately.
I've been running up against the infamous OS X readline issues. I know
some builders here have hacked past it, but I'm looking for a good
workaround... ideally one that works without changes outside the GH
39 matches
Mail list logo