Am Mittwoch, 21. Dezember 2005 15:20 schrieb Daniel Fischer:
i'm 90% sure that straightforward method must be faster for one-time
searches.
I'm far less sure of that. If you have a really short search-pattern, I
think that probably straightforward search is indeed faster (at least, if
the
Bayley, Alistair [EMAIL PROTECTED] writes:
Hear, hear. Compilers, and computationally complex programs in general,
are atypical. IMO, a lot of programming these days is integration work
i.e. shuffling and transforming data from one system to another, or
transforming data for reports, etc. Not
Folks,
I'm trying to monadify the pickler code. sequ below positively looks
like = but you can't really join both pickle and unpickle into a
single monad. I would like to keep the ops together, though, as this
allows me a single specification for both pickling and unpickling.
Cale
Ketil Malde writes:
I'm sorry, but, if we define compiler as a input-process-output
pipeline, then:
shuffling and transforming data = compiler
transforming data for reports = compiler
I actually think a lot of useful programs fit into that category.
Ketil, calling compiler all this
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
PS. About the subject (when to teach IO): don't be sectarians. If
a programming course insists on algorithmics, the IO issues can be
postponed a bit. If it insists on practical data processing, IO
should come in
S Koray Can wrote:
As a newbie... I agree that a newbie should be able to write this
fairly early on:
main = do
x - getLine()
putStrLn (The answer is ++ show(fib(read(x
I'd agree for some definition of 'early'. I'll elaborate:
[snip]
The above code snippet contains
Bayley, Alistair asks (commenting my statement):
_What_ is easier in Scheme than in Haskell? IO, or teaching (IO)?
In my humble opinion, both. Mainly for psychological reasons,
we (well, we, students more than we, old Haskell cowboys...)
are used to the sequentiality of I/O. As people
On 12/22/05, Daniel Carrera [EMAIL PROTECTED] wrote:
S Koray Can wrote:
As a newbie... I agree that a newbie should be able to write this
fairly early on:
main = do
x - getLine()
putStrLn (The answer is ++ show(fib(read(x
I'd agree for some definition of
On 12/22/05, John Meacham [EMAIL PROTECTED] wrote:
Just the idea that you can write things like mapM and replicateM is
enough to blow the mind of many impertive programmers.
Not trying to fan the flames, but one thing I struggle with is
understanding (at a gut level - if you explain the theory,
On 12/22/05, Daniel Carrera [EMAIL PROTECTED] wrote:
Hi all,
How do I write a statement that spans multiple lines?
I have this function:
pythagoras n = [(a,b,c) | a -[1..n], b -[1..n], c -[1..n], a = b, b
c, a*a + b*b == c*c]
This should all be in one line. I know some ways to make the
J. Garrett Morris wrote:
Indent the second line:
pythagoras n = [(a,b,c) | a -[1..n], b -[1..n], c -[1..n], a = b, b
c, a*a + b*b == c*c]
Thanks!
Daniel.
--
/\/`) http://oooauthors.org
/\/_/ http://opendocumentfellowship.org
/\/_/
\/_/I am
Daniel Carrera wrote:
Hi all,
How do I write a statement that spans multiple lines?
I have this function:
pythagoras n = [(a,b,c) | a -[1..n], b -[1..n], c -[1..n], a = b, b
c, a*a + b*b == c*c]
This should all be in one line. I know some ways to make the line
shorter, like
You might also like to try the slightly more efficient...
pyth n = [(a,b,c) | a - [1..n],
b - [a..n],
c - [a+1..n],
a*a + b*b == c*c ]
Greg Buchholz
___
Haskell-Cafe
On Thu, 22 Dec 2005, Paul Moore wrote:
...
FWIW, I don't really see why the -M functions are needed either. It's
something to do with the fact that map is for lists, and mapM is for
monads, which are a more general type of sequence than a list. But why
mapM isn't therefore a superset of map,
If you try a recent snapshot of cvs ghc, its ghci should support generating
project-wide tags files for emacs and vim (btw, the online help for vim has
another example of using tags for code browsing: showing the definition
for the identifier under cursor in a preview window - very handy for
On Thu, Dec 22, 2005 at 02:02:56PM +, Daniel Carrera wrote:
I had never heard of mapM, or other -M functions. I can't imagine why
those would be needed. It seems like pointless duplication.
(!!!) then you are missing out. the M functions (and monadic traversal
functions in general)
Greg Buchholz wrote:
You might also like to try the slightly more efficient...
pyth n = [(a,b,c) | a - [1..n],
b - [a..n],
c - [a+1..n],
a*a + b*b == c*c ]
Cool. I'm amazed that actually works. I've been writing
On 12/22/05, Daniel Carrera [EMAIL PROTECTED] wrote:
Paul Moore wrote:
As I say, I'm not trying to criticize anyone here, but it seems to be
quite hard to get across to people who have understood and assimilated
this sort of stuff, just how hard it feels to newcomers. We understand
the
SKC This entire discussion is about 'breaking a cyclic graph of conceptual
SKC dependencies'. Unfortunately, I don't think it can be done well in short
SKC amount of time.
I bet if we sat down and listed all the concepts required to write
idiomatic Haskell (even idiomatic Haskell 98 (whatever
In neither GHCi nor Hugs (so far as I know) is it possible to
interactively enter definitions. coming from Scheme, this was a bit of
a surprise, as I'm used to being able to enter, say
(define mysquare
(lambda (x)
(* x x)))
Is this just a matter of the feature not being implemented, or
In ghci at least, you can enter definitions like that using let binding:
let mysquare x = x * x
/g
On 12/22/05, Greg Woodhouse [EMAIL PROTECTED] wrote:
In neither GHCi nor Hugs (so far as I know) is it possible to
interactively enter definitions. coming from Scheme, this was a bit of
a
There was a good discussion about this on an earlier thread.
http://www.mail-archive.com/haskell-cafe@haskell.org/msg11372.html
In fact, this exact question sparked a number of long threads. :-)
(First steps in Haskell, Tutorial upload, Proposal for a First Tutorial.)
Cheers,
Jared.
--
[EMAIL
Hello,
Version 0.6.0 of HDBC and the Sqlite3 bindings are now available.
New features since Tuesday's 0.5.0 announcement include:
* New type system for marshalling different Haskell types back and
forth
* New support for querying meta-information about the server
* Much improved
At Thu, 22 Dec 2005 11:26:51 +,
Joel Reymont wrote:
Folks,
I'm trying to monadify the pickler code. sequ below positively looks
like = but you can't really join both pickle and unpickle into a
single monad. I would like to keep the ops together, though, as this
allows me a
Hi guys,
So one of the big things in object oriented programming is
encapsulation, and I'm wondering how to do it properly in
Haskell. How do you define new data types but minimize the
dependence of external packages on the exact nature of the
data definition?
Hi everyone,
I'm relatively new to Haskell and was a bit troubled by the problem
of assigning a type to infinite structures. To give a clear example,
suppose we have
data Nat = Zero | Succ Nat
omega = Succ omega
What type then does omega have? According to GHCi, omega :: Nat. But
surely
On 12/23/05, Matt Collins [EMAIL PROTECTED] wrote:
Hi everyone,
I'm relatively new to Haskell and was a bit troubled by the problem
of assigning a type to infinite structures. To give a clear example,
suppose we have
data Nat = Zero | Succ Nat
omega = Succ omega
What type then does omega
Paul Moore wrote:
Not trying to fan the flames, but one thing I struggle with is
understanding (at a gut level - if you explain the theory, I'll
understand, but go away none the wiser in practice...) why I need mapM
as well as map (and all the other -M functions, liftM, foldM, etc...)
All you
David Roundy wrote:
Hello all,
I have a question about how to create the right kind to declare lists to be
a class. I have a class Foo
class Foo f where
foo :: f a - Foo
and I want to define that a list of Foos is also a Foo, but can't see how
to do it. I imagine something like
instance
Thanks Sebastian, I guess I was ignoring the type of Succ like you
said. Glad to have passed that mental barrier!
On 23/12/2005, at 12:14 PM, Sebastian Sylvan wrote:
On 12/23/05, Matt Collins [EMAIL PROTECTED] wrote:
Hi everyone,
I'm relatively new to Haskell and was a bit troubled by the
I'm curious what this user community would come up with in order to
implement the curious zigzag data structure. If you haven't heard
anything about it, its a simple but peculiar idea, by the guy who
dreamed up the Xanadu project: http://xanadu.com/zigzag/.
Conceptually it is cells with some
That sounds like a special case of what is called a graph in
mathematics and computer science.
See:
http://en.wikipedia.org/wiki/Graph_%28mathematics%29
and
http://en.wikipedia.org/wiki/Graph_%28data_structure%29
Essentially, the structure that they define on that site is a graph
with arcs
Essentially, the structure that they define on that site is a graph
with arcs labelled in such a way that any vertex has at most one
outgoing arc with that label (and hence at most one incoming arc with
that label as well).
Sorry, I obviously didn't read that carefully enough, and both
33 matches
Mail list logo