Glynn Clements <[EMAIL PROTECTED]> writes:
> The Haskell functions accept or return Strings but interface to OS
> functions which (at least on Unix) deal with arrays of bytes (char*),
> and the encoding issues are essentially ignored. If you pass strings
> containing anything other than ISO-8859-1
Matthew Roberts <[EMAIL PROTECTED]> writes:
>> [Point-free] compositions of functions with arity greater than 1,
>> [...] compositions of sections of composition or application,
>> arrow notation without the sugar, and so forth---will always be more
>> difficult to read and understand than the dir
Hi,
I've started using Parsec for my parsing needs, and must say I'm very
happy with it. There is one thing that I'm struggling with
implementing though.
Basically, I want to parse a file containing multiple records. I
already have a parser for a single record, and of course I could parse
the
"Claus Reinke" <[EMAIL PROTECTED]> writes:
> no direct answer to your question, but a general comment on the
> original problem (speaking from bad experience;-): things like
> "head" have no place in a Haskell program of any non-trivial size,
> because of their useless error messages.
I must say
Donn Cave <[EMAIL PROTECTED]> writes:
>> Ideally, I think something like this should be the default behavior
>> for these functions.
> But something like this should happen for any function, shouldn't
> it?
Any function where pattern match could fail, yes. (Or should that be
any partial functi
Peter Simons <[EMAIL PROTECTED]> writes:
> The only reason I could think of is that a function is
> considered to be "internal", meaning: You don't want users
> of the module to rely on the function still being there (or
> still working the same way) in any of the next revisions.
Right.
(I guess
Gracjan Polak <[EMAIL PROTECTED]> writes:
> find (isSuffixOf "needle") (inits "haystack")
Hmm...
While the result isn't exactly the same, I suspect
using isPrefixOf and tails would be more efficient.
> This one is beautiful, but not very practical.
Unless you have very repetitive data and/or
Gour <[EMAIL PROTECTED]> writes:
> This is really a nonsense. The word has lot of meanings. Let them take
> a look in any Sanskrit dictionary.
Hmm.. I must have displaced mine, but are you suggesting Enlightenment
(the window manager) could be next?
>> So what will happen in the long term? As ye
Christoph Bauer <[EMAIL PROTECTED]> writes:
> data SourcePos = SourcePos SourceName !Line !Column
>deriving (Eq,Ord)
> My poor haskell knowledge says me, that Line and Column is
> always strict.
Yes.
> So, what does the following function?
> forcePos :: SourcePos -> S
Hi,
One slight annoyance using Haskell is the inability to load modules
with type problems in the interactive environment (i.e. GHCi). When I
have a type error, it would be nice to have an interactive way to
explore what the compiler thinks about the types involved -- as it is,
I have to resort
Greg Buchholz <[EMAIL PROTECTED]> writes:
> Diff arrays have an immutable interface, but rely on internal updates in
> place to provide fast functional update operator //.
While a cool concept, ISTR that somebody benchmarked these some time
ago, and found the performance to be fairly poor in prac
Udo Stenzel <[EMAIL PROTECTED]> writes:
> You messed the argument order to readArray up. Even with that repaired,
> you'll need a type signature somewhere to help ghc resolve the
> overloading of newArray and readArray, which is surprisingly tricky due
> to the "s" that must not escape.
I have s
Martin Vlk <[EMAIL PROTECTED]> writes:
> http://www-i2.informatik.rwth-aachen.de/Staff/Current/michaelw/sttt-ml-haskell.pdf
Interesting to see others' experiences, even if they are slightly
negative.
> It contains descriptions of lots of real-world problems and how
They are only implementing T
Nils Anders Danielsson <[EMAIL PROTECTED]> writes:
> My program is failing with head [], or an array bounds error, or some
> other random error, and I have no idea how to find the bug. Can you
> help?
>
> Compile your program with -prof -auto-all (make sure you have the
> profiling librari
Adam Wyner <[EMAIL PROTECTED]> writes:
> I really want to get the following sort of report for the type:
> negationAtomicProps atomicProps1 :: PropList
GHCi seems to get this right. Is that an option for you?
-k
--
If I haven't seen further, it is by standing in the footprints of giants
_
Bill Wood <[EMAIL PROTECTED]> writes:
>> The variable mem is a so-called hybrid variable; it crunches
>> together 2 different concepts: a boolean value (could I allocate
>> memory?) and an address value (what is the address where I can find
>> my allocated memory).
IMO, Maybe is exactly the oppsi
Karl Grapone <[EMAIL PROTECTED]> writes:
> I've just started learning Haskell, and I must admit I'm finding it a
> bit hard to get my head around the typing system...
Okay.
> What I want to be able to do is add and remove fields while the system
> is running,
While I'm sure you'll get some adva
Michael Vanier <[EMAIL PROTECTED]> writes:
> import Prelude hiding length
> whereas the correct syntax is
> import Prelude hiding (length)
> I spent nearly an hour beating my head against this. Can someone fix this
> in the documentation?
Or, alternatively, fix the Haskell syntax? It wou
Joel Reymont <[EMAIL PROTECTED]> writes:
> If I don't cast then how do I convert this code?
Uh, what is wrong with divMod?
*Main Data.Word> (100::Word64) `divMod` (2^32)
(2,1410065408)
> doubleToInts d = runST ( [...]
This will only give you a headache. :-)
-k
--
If I haven't s
Joel Reymont <[EMAIL PROTECTED]> writes:
> I must be missing something because I don't think the code below
> converts a double.
Yes, sorry, my bad. I was (and is) confused about what you wanted to
do.
-k
--
If I haven't seen further, it is by standing in the footprints of giants
___
David Roundy <[EMAIL PROTECTED]> writes:
>> Bah, simple libraries. They don't have to be part of the Standard
>> Prelude.
> I completely agree. I'd rather decrease the number of libraries defined in
> the language itself and decouple library standardization from the
> definition of the language
[EMAIL PROTECTED] writes:
> Hi there, I'm just wondering if there is a command for emptying a list?
Not really. If you want an empty list, you can use [].
> Also, is there any way to incorporate list operations (concatenation in
> particular) in a do-statement on lists? Every time I try it giv
Udo Stenzel wrote:
That raises the question: Should combining functions on containers be
provided in a strict variant? Should strict application be the default?
With the exception of lists, I generally tend to want strict behavior
for collections. Combined with the principle of least surpris
Scherrer, Chad wrote:
Sorry to drag this thread out, but here's one more thing you might
try...
(This is the café, isn't it? :-)
Another option is perhaps to pack both char and count in one Int and use
some kind of Set.
This should save some space, and possibly time as well (presuming
bit
Sebastian Sylvan wrote:
On 11/8/05, Jan-Willem Maessen <[EMAIL PROTECTED]> wrote:
Just wanted to let people know that I've been working on improving
Data.HashTable, with the help of Ketil Malde's badly performing code
Always happy to help, of course - bad performance R us:-)
Request
Jan-Willem Maessen wrote:
I think that if I can get unsafeFreeze/unsafeThaw to work reliably,
it'll finally outperform Data.Map on your example. I haven't yet
played with the hash function, which looks kind of bad; there may be
hope for improvement there as well.
Great!
User-level Thaw
Gour wrote:
Nobody said that DocBook does not work fine. However let me quote SPJ's
message:
However, I still wonder if there are things we could do that would make
it easier for people to contribute. Here are two concrete suggestions:
^^^
- Make it possible for people to add comments,
Wolfgang Jeltsch wrote:
Hmm, MediaWiki already supports the concept of discussion pages.
Yes, I know. Perhaps I was less than lucid, so to clarify:
But I doubt that it's a good thing to maintain DocBook sources via a wiki.
I think it would be best to keep the documentation in DocBook a
Wolfgang Jeltsch wrote:
Oh no! Converting LaTeX to HTML is terrible, in my opinion. One reason for
this is that LaTeX isn't a markup language and provides a mixture of logical
and visual macros.
Conversely, I've occasionally tried to convert stuff - I think a TMR
issue was one example, and
Benjamin Franksen wrote:
If your editor is a little smarter still, it can do the Haskell
layout without braces automatically too. The emacs mode helps with
this. Yi/hIDE should be able to do it perfectly once it's in a
generally usable state. :)
Hmm, how would your super intelligent text ed
Fraser Wilson <[EMAIL PROTECTED]> writes:
>Isn't there a potential for confusion with function
> composition (f . g)?
> Perhaps, but I always have spaces on either side when it's function
> composition.
Good for you. Syntax that changes depending on spacing is my number
one
Antti-Juhani Kaijanaho wrote:
Ketil Malde wrote:
[about A.b and A . b potentially meaning different things:]
Syntax that changes depending on spacing is my number
one gripe with the Haskell syntax
I've generally considered that one of the good ideas in most current
languages
"Simon Marlow" <[EMAIL PROTECTED]> writes:
> I'm assuming you don't consider the distinction between '::' and ': :'
> to be a problem - the justification for this is simple and logical: a
> double colon '::' is a reserved symbol, in the same way that 'then' is a
> reserved identifier.
Intuitively
Cale Gibbard <[EMAIL PROTECTED]> writes:
> This really isn't so bad in practice though. I've certainly never been
> confused by it.
Well, what can I say? Good for you?
> You'd have to go out of your way to construct a
> situation in which it's potentially confusing
No.
> There are much more
raptor <[EMAIL PROTECTED]> writes:
> split _ [] = []
> split char (x:xs)
> | x /= char = x : split char xs
> | otherwise = []
> *Main> split 'x' str
> "testing"
> I want :
> ["testing","split",...]
> How do i do this.
Collect the read chars in a temp, when the separator is dete
Jimmie Houchin <[EMAIL PROTECTED]> writes:
> I have been perusing the haskell.org site and reading some of the
> tutorials. I just didn't want to expend lots of time just to find out
> that my math skills were woefully inadequate. I am grateful to learn
> that I can continue pursuing Haskell.
Lo
"Scherrer, Chad" <[EMAIL PROTECTED]> writes:
> module Main where
> module A where
> module B where
> in a single file. This example is straight from chapter 5 of the Report,
> and no mention is made (that I could find) about modules needing to be
> in separate files. But this won't load in gh
Einar Karttunen writes:
> To matters nontrivial all the *nix variants use a different
> more efficient replacement for poll.
> Solaris has /dev/poll
> *BSD (and OS X) has kqueue
> Linux has epoll
Since this is 'cafe, here's a page has some performance testing of
epoll:
http://lse.sourcefor
"Simon Marlow" <[EMAIL PROTECTED]> writes:
> On 16 December 2005 10:05, Joel Reymont wrote:
>
>> I'm trying to restrict GHC to 800Mb of heap at runtime by passing in
>> +RTS -M800M, the machine has 1Gb of memory and top shows free
>> physical memory dropping below 175Mb.
> -M800m should do more o
Chris Kuklewicz <[EMAIL PROTECTED]> writes:
> Prelude> let { fac :: Integer -> Integer; fac 0 = 1; fac n | n > 0 = n * fac
> (n-1) }
As somebody made me aware just the other day, the bracer are only
necessary for nested expressions. So you can just use ; for line
breaks:
Prelude> let fac :: I
Neil Mitchell <[EMAIL PROTECTED]> writes:
> I would have actually said Hugs, and especially the Windows front end
> WinHugs was a lot more suitable for beginners than GHC, but the wiki
> page very much gives the other impression.
Which page are you referring to? I went to look, but couldn't find
Paul Moore <[EMAIL PROTECTED]> writes:
> One thing I'd consider adding is something along the lines of a section:
> == So how do I write "Hello, world"? ==
I've gone and done it. I've perhaps been heavy handed on the original
page, so feel free to complain and/or fix it.
-k
--
If I haven't se
"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, e
Simon Peyton-Jones <[EMAIL PROTECTED]> writes:
> I'm not prepared to add new functions to Haskell 98, but I think
> the clarification of (1) or (2) below would be useful. (2) is nice
> but it makes *all* file reading more expensive, perhaps significantly
> so (e.g. making a complete copy of the
Doug Ransom <[EMAIL PROTECTED]> writes:
> I have configured this message so that replies should go to haskell-cafe
> automatically.
Sure. However, I do 'f' to follow up, which causes both adresses to
be included :-) (Removed haskell@manually)
> What xml parser are you using XML in haskell? I
"D. Tweed" <[EMAIL PROTECTED]> writes:
> Unfortunately the last time I looked at CWEB it still had the same idea
> about identifiers as WEB itself, namely that if they match textually
> they are the same, which makes the automatic indexes produced less useful
> for C++: I've got twelve classes al
Koen Claessen <[EMAIL PROTECTED]> writes:
[Dead/dying compilers/interpreter]
> I know of nobody who is starting to implement a Haskell
> compiler from scratch. What do people think: is this
> a worrying situation?
Only if the remaining tools are insufficient, IMHO. It is
questionable whether t
"Ch. A. Herrmann" <[EMAIL PROTECTED]> writes:
> moved to haskell-cafe
No, but *now* it is. (Does haskell@ strip Reply-To? Bad list! Bad!)
> the problem is that the --majority, I suppose?-- of mathematicians
> tend to overload operators. They use "*" for matrix-matrix
> multiplication as well a
Dylan Thurston <[EMAIL PROTECTED]> writes:
> On Wed, Feb 07, 2001 at 01:57:41PM -0500, Dylan Thurston wrote:
> > ... One point that has not been made: given a class
> > setup like
> >
> > then naive users can continue to use (Num a) in contexts, and the same
> > programs will continue to work.
Brian Boutel <[EMAIL PROTECTED]> writes:
>> The fact that equality can be trivially defined as bottom does not imply
>> that it should be a superclass of Num, it only explains that there is an
>> ugly way of working around the problem.
> There is nothing trivial or ugly about a definition that r
[EMAIL PROTECTED] (Marcin 'Qrczak' Kowalczyk) writes:
>> Why do you stop at allowing addition on Dollars and not include
>> multiplication by a scalar?
> Perhaps because there is no good universal type for (*).
> Sorry, it would have to have a different symbol.
Is this ubiquitous enough that we
William Lee Irwin III <[EMAIL PROTECTED]> writes:
> Some analysis of the value of the literal would need to be
> incorporated so that something like the following happens:
> literal "0" gets mapped to zero :: AdditiveMonoid t => t
> literal "1" gets mapped to one :: MultiplicativeMon
[EMAIL PROTECTED] (Marcin 'Qrczak' Kowalczyk) writes:
> 'negate' defined, as it's obviously meaningless for them. We can put
> 'fromInteger' in some class and 'negate' in its subclass, and make
> only the former instance for natural numbers.
Nitpick: not necessarily its subclass, either. We can
"Manuel M. T. Chakravarty" <[EMAIL PROTECTED]> writes:
> You want to be able to write
> f 1 2 + g 3 4
> instead of
> (f 1 2) + (g 3 4)
I do? Personally, I find it a bit confusing, and I still often get it
wrong on the first attempt. The good thing is that the rule is simple
to remember.
Jerzy Karczmarczuk <[EMAIL PROTECTED]> writes:
>> BTW, before I knew Haskell I exprimented with a syntax in which 'x f'
>> is the application of 'f' to 'x', and 'x f g' means '(x f) g'.
> Hmmm. An experimental syntax, you say...
> Oh, say, you reinvented FORTH?
Wouldn't
x f g
in a For
Fergus Henderson <[EMAIL PROTECTED]> writes:
> If experts like Alastair Reid
> have trouble understanding the operational behaviour of simplified
> examples like this one, how are ordinary programmers to cope with
> complicated programs? Is lazy functional programming too difficult for
> ordinar
"Cagdas Ozgenc" <[EMAIL PROTECTED]> writes:
> Could you help me on this notation?
Perhaps?
>> data Foo = Foo { a :: Int, b :: String }
This declares a Foo constructor with two named fields, and Int "a" and
a String "b". This is equivalent to declaring
data Foo = Foo Int String
but w
Saswat Anand <[EMAIL PROTECTED]> writes:
> As regard to Marcin's suggestion of using a list of compact arrays,
> although elements can be accessed faster, there will be a lot if
> redundancy since windows are overlapping. So consecutive arrays
> will contain almost same data.
Hmmm - a circular
Dylan Thurston <[EMAIL PROTECTED]> writes:
> Right. In Unicode, the concept of a "character" is not really so
> useful;
After reading a bit about it, I'm certainly confused.
Unicode/ISO-10646 contains a lot of things that aren'r really one
character, e.g. ligatures.
> most functions that tradi
[Posted to haskell-cafe, since it's getting quite off topic]
"Kent Karlsson" <[EMAIL PROTECTED]> writes:
>>> for a long time. 16 bit unicode should be gotten rid of, being the worst
>>> of both worlds, non backwards compatable with ascii, endianness issues
>>> and no constant length encoding...
"Kent Karlsson" <[EMAIL PROTECTED]> writes:
>> You have endianness issues, and you need to explicitly type text files
>> or insert BOMs.
> You have to distinguish between the encoding form (what you use internally)
> and encoding scheme (externally).
Good point, of course. Most of the argume
Mark Carroll <[EMAIL PROTECTED]> writes:
> On Tue, 9 Oct 2001, Ashley Yakeley wrote:
>> At 2001-10-09 11:55, Mark Carroll wrote:
>>> What is the rationale for when Haskell demands a "=" and when it
>>> demands a "->"?
Okay, I can't give you anything formal, but here's my intuitive
understandin
Petter Egesund <[EMAIL PROTECTED]> writes:
> I load my file in one chunk, and does a lot of substitutes on the string -
> this is quick eating all my memory and the computers start to get really
> slow.
Keep in mind that Strings are lists of characters. I think (somebody
correct me if I'm wrong)
Petter Egesund <[EMAIL PROTECTED]> writes:
> fun :: String -> String
> look for pat1 in string - if found subst with sub1
> look for pat2 in string - if found subst with sub2
> look for pat3 in string - if found subst with sub3
> recurse until no pattern is found
I would struc
Jeff Newbern <[EMAIL PROTECTED]> writes:
> Thanks for your input. I am mainly interested in this functionality to
> enhance my unit tests. I want to be able to run test cases with limits
> on time, heap, stack, etc. and fail the test if it exceeds the limits.
Well, if you can isolate the tests
Christopher Milton <[EMAIL PROTECTED]> writes:
> I think Haskell can be used to solve several, if not all, of
> the seven problems.
What's this? Is there an URL with more information?
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants
Derek Elkins <[EMAIL PROTECTED]> writes:
>> Either use a different name for your operator, or specify the "+" that
>> you want by writing "OperationTest.+" instead of "+".
> You can also hide the Prelude (+), though it is a somewhat useful
> function.
Wouldn't making Nat an instance of Num also
Alex Gontcharov <[EMAIL PROTECTED]> writes:
> I'm fairly new to Haskell, I'd like to know how to convert
> a list of Strings of type IO [String] to Int.
Ah... an IO [String] is *not* a list of strings, it is an IO action
that can produce a list of strings. You can only get at the strings
inside
"Pajo Patak" <[EMAIL PROTECTED]> writes:
> I want to return a list, from and list of lists (all integers), where
> is the erroe in the code?
> nthList :: [[a]] -> Int -> [a]
> nthList ([x]:xs) 1 = [x]
> nthList ([x]:xs) (n+1) = nthListh xs n
Did you try it at all?
Prelude> let { nthList
Hal Daume III <[EMAIL PROTECTED]> writes:
>> class Null a where
>> nullify :: a -> a
Hmm...why not
class Null a where
null :: a
(you are just throwing away the parameter anyway)?
>> I then tried the following:
>>
>> instance Num a => Null a where
>> nulli
"Iavor S. Diatchki" <[EMAIL PROTECTED]> writes:
> it refers to type constructor.
Okay, thanks for the clarification.
> since value constructors are not allowed
> in the "instance head" the terminology is not ambiguous.
You know, I'm going to have to take issue with this. Yes, it's not
ambigo
"horsh" <[EMAIL PROTECTED]> writes:
> Could anyone please explain why these two things are not equivalent:
One of them has a type signature?
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing lis
"Arjan van IJzendoorn" <[EMAIL PROTECTED]> writes:
>>newtype Method = Method String
>>getMethod = Method "GET"
>>putMethod = Method "PUT"
>>doMeth getMethod = ...
>>doMeth putMethod = ...
> You will have to write:
>
> doMeth (Method "GET") = ...
> doMeth (Method "PUT") = ...
"Russ Lewis" <[EMAIL PROTECTED]> writes:
> Another newbie question: Is it possible to catch _|_ - that is, to
> encounter it, handle it and continue?
Since _|_ is the value of a non-terminating computation, this requires
you to solve the halting problem. GHC does occasionally detect loops,
but f
"Russ Lewis" <[EMAIL PROTECTED]> writes:
> Oh. I was figuring that the runtime would detect _|_ whenever
> evaluation requires that it calculate a given expressoin, and that
> expression is currently being evaluated...that is, some subset of an
> expression evaluates to the expression itself.
Yo
Paul Cosby <[EMAIL PROTECTED]> writes:
> Every time I try to use [underscore] in an definition it says
> something like the symbol /017 is not recognised
Could that be \017, i.e. octal 17 (defined in ASCII as SI, whatever
that may be)?
> Any help suggestions?
Wild guess: Are your files using th
[Moved to -cafe at SPJ's request]
"Serge D. Mechveliani" <[EMAIL PROTECTED]> writes:
> On Mon, Apr 26, 2004 at 10:09:18PM +0200, Ketil Malde wrote:
>> "Serge D. Mechveliani" <[EMAIL PROTECTED]> writes:
>>>
"S. Alexander Jacobson" <[EMAIL PROTECTED]> writes:
> assuming Moore's law lasts
I suspect Moore's law is dead or dying. Intel just announced the
latest "Prescott" P4 at 3.6 GHz, up from 3.2 last June. That's only a
12.5% increase. One year before that, it was about 2.5GHz, or almost
30%. I di
"Iavor S. Diatchki" <[EMAIL PROTECTED]> writes:
> one thing i don't like about programming contests, is that usually
> time is very limited, so often one ends up with terrible hacks that
> kind of work...
I'm not so sure - at least in earlier contests, when programs were
submitted, they were fe
John Kozak <[EMAIL PROTECTED]> writes:
> data Pixel a = Pixel !a !a !a deriving Show
> I use ImageMagick to load the image, then build an Array of Pixel
> Floats. Building the array takes 45 seconds on a 2.5Ghz P4 with
> code compiled -O2, which seems slow to me - are my expectations
> u
paolo veronelli <[EMAIL PROTECTED]> writes:
> All these are very natural with dictionaries, so I'd like to figure
> out the haskell view.
I've no clue what you're doing (or for that matter, what RDFs are),
but is there any reason Data.FiniteMap doesn't do the job?
-kzm
--
If I haven't seen furt
MR K P SCHUPKE <[EMAIL PROTECTED]> writes:
> Well I have to say the dataflow style of lazy programming made me think
> Haskell would be ideal for multi-processor use (and now HyperThreading
> is common most PCs have more than one processor from the code's point
> of view)...
> I was disappointed
Jon Cast <[EMAIL PROTECTED]> writes:
>> factor c constant overhead,
> ^^
> What makes you think the overhead is constant?
(Referring to the overhead introduced by boxing and such, not
parallelizing. Sorry if that wasn't clear)
-kzm
--
If I haven't seen further, it i
901 - 983 of 983 matches
Mail list logo