Hi - here is an exchange that was off-list by accident:
Original Message
From: Brian Smith
To: Brian Hulley
Sent: Tuesday, August 22, 2006 5:50 AM
(Brian, I see that my last reply only went to you and so I forwarded
it to the list. Since you replied to me directly, I am responding to
Hi,
Now that I have read the tutorials, I think that the best way to learn
Haskell would be to use the language and write something simple yet
useful. I noticed that Haskell lacks a module for reading/writing csv
(comma separated value) files, so I thought I could implement that.
Questions:
1.
On Tue, 22 Aug 2006, Tamas K Papp wrote:
Hi,
Now that I have read the tutorials, I think that the best way to learn
Haskell would be to use the language and write something simple yet
useful. I noticed that Haskell lacks a module for reading/writing csv
(comma separated value) files, so
On 21/08/06, Udo Stenzel [EMAIL PROTECTED] wrote:
Neil Mitchell wrote:
I'm trying to write out a binary file, in particular I want the
following functions:
hPutInt :: Handle - Int - IO ()
hGetInt :: Handle - IO Int
For the purposes of these functions, Int = 32 bits, and its got to
Check first MissingH.
I remember that it came with some parsing routines for common text formats.
Best,
Titto
-Original Message-
From: [EMAIL PROTECTED] [mailto:haskell-cafe-
[EMAIL PROTECTED] On Behalf Of Tamas K Papp
Sent: 22 August 2006 10:20
To: Haskell Cafe
Subject:
Hi Tamas,
Questions:
1. Please tell me if you know of a csv module, because then I would do
something else.
I think MissingH contains a simple CSV parser, but the server seems to be
down.
2. I am looking for a parser, but I don't know Haskell parsers. Is
Parsec a good choice?
On Tue, Aug 22, 2006 at 11:26:45AM +0200, Henning Thielemann wrote:
See also
http://www.xoltar.org/languages/haskell.html
http://www.xoltar.org/languages/haskell/CSV.hs
Thanks. Haskell is incredibly neat ;-)
Now I need to find something else for practice. Is there anything
Now I need to find something else for practice.
How about writing a CiteULike plugin? For example, what could be
really useful is if somebody wrote one for the French open archive
HAL. This will give you a nice chance to play maybe with parsing
stuff, or one of the HTML/XML libraries, or
Hello Tamas,
Tuesday, August 22, 2006, 1:59:28 PM, you wrote:
Now I need to find something else for practice. Is there anything
related to data analysis/statistics that is lacking is Haskell?
general String/List library containing search, replace, split and all other
general algorithms
--
Hello Alistair,
Tuesday, August 22, 2006, 1:29:22 PM, you wrote:
What's wrong with the following i.e. what assumptions is it making
(w.r.t. pointers) that I've missed? Is endian-ness an issue here?
data written by your module on big-endian machine, can't be read by
the same module in the
Bulat Ziganshin [EMAIL PROTECTED] wrote:
2) allow to use type classes in type declarations like the types
itself. for example, allow the following:
f :: Num a = a - Int
write as
f :: Num - Int
and following:
sequence :: Monad m = [m a] - m [a]
write as
sequence :: [Monad a] - Monad
Hello Malcolm,
Tuesday, August 22, 2006, 4:22:50 PM, you wrote:
2) allow to use type classes in type declarations like the types
itself. for example, allow the following:
f :: Num a = a - Int
write as
f :: Num - Int
and following:
sequence :: Monad m = [m a] - m [a]
write as
On 8/22/06, Bulat Ziganshin [EMAIL PROTECTED] wrote:
what i propose is not full replacement of existing syntax - quite the
contrary it is just a syntax sugar for most frequent cases of using
classes in function signatures. the key idea is that in most cases we
use only one type class for each
Bulat Ziganshin wrote:
f :: Num a = a - Int
write as
f :: Num - Int
so, while this proposal is rather minor, i think that it is Good thing
I wouldn't like it because I'd like to eventually make the class namespace
separate from the tycon namespace so that I could write:
class Object a
Brian Hulley wrote:
Bulat Ziganshin wrote:
f :: Num a = a - Int
write as
f :: Num - Int
Actually separating the class namespace from the tycon namespace would allow
you to get a very similar effect to the use of abstract interfaces in C++
ie:
class Object a where
name :: a -
Brian Hulley wrote:
-- generated automatically?
data Object = forall a. Object a
Ooops! ;-)
data Object = forall a. Object a = Object a
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Brian Hulley wrote:
Bulat Ziganshin wrote:
f :: Num a = a - Int
write as
f :: Num - Int
so, while this proposal is rather minor, i think that it is Good
thing
I wouldn't like it because I'd like to eventually make the class
namespace separate from the tycon namespace...
Apologies for that
Hello Bryan,
On 2006-08-22, Bryan Burgers [EMAIL PROTECTED] wrote:
so, while this proposal is rather minor, i think that it is Good thing
I disagree. As a new learner to Haskell, I already have a hard time
keeping Constructors, Types, and Classes straight. I know what they
all are and what
Now I need to find something else for practice. Is there anything
related to data analysis/statistics that is lacking is Haskell?
A native implementation of multiparameter data fitting (requires some
linear algebra) like:
Sec 15.4 of http://www.library.cornell.edu/nr/bookcpdf.html
or
2. I am looking for a parser, but I don't know Haskell parsers. Is
Parsec a good choice?
Parsec is definitely a good choice, but beware that it parses the whole
input before returning, thus it may consume a huge batch of memory. As
CSV is a line oriented format, you should make your
Arie said:
{... This is an instance of a general conflict: should we sacrifice nice
notation for ease of learning? You could make a similar case for list
comprehensions, for example: they complicate matters for newcomers (yet
another meaning of brackets and pipe) ...}
I have to totally agree
Hello Brian and others,
On 2006-08-22, Brian Hulley [EMAIL PROTECTED] wrote:
I wouldn't like it because I'd like to eventually make the class namespace
separate from the tycon namespace so that I could write:
class Object a where
...
data Object = forall a. Object a =
John,
Thanks very much for that bit of insight. I am not really writing
anything right now that is in more hurry than what Haskell can handle
nicely. I was feeling a bit guilty as, Shao said, I use $ over (.)
and thought that my code could get some amount of ridicule as to
style... when it gets
Bulat Ziganshin wrote:
Hello Malcolm,
Tuesday, August 22, 2006, 4:22:50 PM, you wrote:
2) allow to use type classes in type declarations like the types
itself. for example, allow the following:
f :: Num a = a - Int
write as
f :: Num - Int
and following:
sequence :: Monad m = [m a] - m
Hello Arie,
Tuesday, August 22, 2006, 8:24:17 PM, you wrote:
data Object = forall a. Object a = Object a
I like the idea of separating class and type constructor namespaces, and
then being able to use existentials as in your example (although the
latter would also belong in the category
Hello Arie,
Tuesday, August 22, 2006, 7:24:34 PM, you wrote:
I disagree. As a new learner to Haskell, I already have a hard time
keeping Constructors, Types, and Classes straight. I know what they
all are and what they all do, but sometimes I really have to think
hard to remember which is
Brandon Moore wrote:
Perhaps there is something similar that could be done with type
classes. In particular, I very much like Daan's rule of only inlining
a constraint if the type it binds is only used once, which would mean
Num - Num - Num
would be equivalent to
(Num a, Num b, Num c) = a - b
Hello Neil,
Monday, August 21, 2006, 7:23:41 PM, you wrote:
type DiffArray = IOToDiffArray IOArray
Is there any difference between the above definition and:
type DiffArray a b = IOToDiffArray IOArray a b
Is the first prefered for any reason?
look at
Bulat Ziganshin wrote:
from one my module:
copyStream :: (BlockStream h1, BlockStream h2, Integral size)
= h1 - h2 - size - IO ()
in my library and found the way to simplify most of their signatures:
copyStream :: BlockStream* - BlockStream** - Integral - IO ()
i think that
Hello Brian,
Tuesday, August 22, 2006, 9:35:21 PM, you wrote:
I feel if it ain't broken don't fix it, and not only is the existing
syntax not broken, it's already (imho) absolutely perfect in it's clarity
and consistency
it's because you not programmed a lot with type classes. if you start,
(Sorry for the late reply; have been on holiday.)
No problem. Your email system was kind enough to say when you'd be back :-)
I've used it to diff fairly large files (hundreds of K's, if not Megs)
where there were few differences. It seemed to perform OK, and in cases
where GNU diff (or
Bulat Ziganshin wrote:
Hello Brian,
Tuesday, August 22, 2006, 9:35:21 PM, you wrote:
I feel if it ain't broken don't fix it, and not only is the
existing syntax not broken, it's already (imho) absolutely perfect
in it's clarity and consistency
it's because you not programmed a lot with type
Bulat Ziganshin wrote:
Subtyping introduced in very natural (at least for OOP souls) way. We
may, for example, have functions:
doit :: MemBuf - IO Int
hRequestBuf :: MemoryStream - IO Int
hTell :: SeekableStream - IO Integral
and call doit - hRequestBuf - hTell and then return result, and all
On Tue, Aug 22, 2006 at 08:59:40AM -0700, Daan Leijen wrote:
2. I am looking for a parser, but I don't know Haskell parsers. Is
Parsec a good choice?
Parsec is definitely a good choice, but beware that it parses the whole
input before returning, thus it may consume a huge batch of
Excerpt from Bulat Ziganshin :
i think that definitions with omitted arguments can be more hrd to
understand to newbie haskellers, especiallyones who not yet know the
language. as Tamas suggests, this page can be used to present to such
newbies taste of Haskell so listing all the parameters may
Hello Brandon,
This could be handled with existential wrappers, except that the
wrapping is annoying, and probably interferes with optimizing when a
concrete type is known. Instead, a few changes to type synonyms handle
Bulat's cases.
With the proper interpretation, type synonyms like
GHC's great space profiling tools don't appear to be much help when your
leaked memory is stored in references (IORefs, StablePtrs, etc). I had
a real-life case where the allocation profile showed me where the leaked
data came from, and I could guess that it was being held by some
reference, but
Arie Peterson wrote:
Hello Brandon,
This could be handled with existential wrappers, except that the
wrapping is annoying, and probably interferes with optimizing when a
concrete type is known. Instead, a few changes to type synonyms handle
Bulat's cases.
With the proper interpretation,
38 matches
Mail list logo