stefan:
> Al,
>
> >Has there been any work on extending Haskell's type system with
> >structural subtyping?
>
> Koji Kagawaga. Polymorphic variants in Haskell. In Andres Loeh,
> editor, Proceedings of the 2006 ACM SIGPLAN Workshop on Haskell,
> Portland, Oregon, USA, September 17, 2006, p
bulat.ziganshin:
> Hello Andrew,
>
> Thursday, May 31, 2007, 11:47:28 PM, you wrote:
> > (Otherwise... wasn't there some library somewhere for serialising values
> > in binary?)
>
> Binary, AltBinary (see latest HCAR), just an example using AltBinary:
>
> main = do
> let s = encode (1.
jules:
> Donald Bruce Stewart wrote:
> >> let s = encode (1.1 :: Float)
> >> :t s
> >s :: Data.ByteString.Lazy.ByteString
> >> s
> >LPS ["\NUL\NUL\140\204\205\255\255\255\255\255\255\255\233"]
> >
> >> decod
andrewcoppin:
> Donald Bruce Stewart wrote:
> >See also the older NewBinary,
> >http://hackage.haskell.org/cgi-bin/hackage-scripts/package/NewBinary-0.1
> >
>
> Now that's just ironic...
>
>
> Incidentally, I've been thinking. You *might*
Phlex:
> Hello all,
>
> I'm coming from the OO world, and there's something i don't quite
> understand in the way haskellers manipulate data (as all functional
> programmers i guess).
>
> Let's say i have a deep nested data structure.
> Universe containing galaxies, containing solar systems, co
apfelmus:
> Phlex wrote:
> > Donald Bruce Stewart wrote:
> >>
> >> Imagine updating a node in a tree by just detaching and reattaching a
> >> pointer.
> >>
> >> [1] [1]
> >> / \
almeidaraf:
> On 6/3/07, Rafael Almeida <[EMAIL PROTECTED]> wrote:
> >The site seems to be asking for the internal floating point
> >representation. So it doesn't matter if it's IEEE 754, if the ints are
> >2-complements, or whatever. I used this code as a quick hack for one of
> >my programs, but
lutz:
> Does anyone have a haskell compiler for True64 (formerly known as OSF/1) on
> Alpha hardware?
>
> I'm currently unable to compile the first bootstrap compiler.
> Any hint which compiler should I start with?
>
> I'll send detailed error reports only if I do not succeed in the next hours.
mdanish:
> Hello,
>
> I've been playing with the INTEST problem on SPOJ which demonstrates
> the ability to write a program which processes large quantities of
> input data. http://www.spoj.pl/problems/INTEST/
> But when I make a slight modification, the program chews up a ton more memory
> an
dons:
> mdanish:
> > Hello,
> >
> > I've been playing with the INTEST problem on SPOJ which demonstrates
> > the ability to write a program which processes large quantities of
> > input data. http://www.spoj.pl/problems/INTEST/
>
> > But when I make a slight modification, the program chews up
clawsie:
> i recently saw a (yet-another) benchark comparing various languages:
>
> http://www.timestretch.com/FractalBenchmark.html
>
> while no haskell example was listed, i thought i would try a naive
> implementation myself for comparison. it is available here:
>
> http://www.b7j0c.org/dev/h
dons:
> dons:
> > mdanish:
> > > Hello,
> > >
> > > I've been playing with the INTEST problem on SPOJ which demonstrates
> > > the ability to write a program which processes large quantities of
> > > input data. http://www.spoj.pl/problems/INTEST/
> >
> > > But when I make a slight modificatio
andrewcoppin:
> Donald Bruce Stewart wrote:
> >Some things to remember using Doubles:
> >
> >* {-# OPTIONS -fexcess-precision #-}
> >* -fvia-C
> >* -fbang-patterns
> >* -optc-O2 -optc-mfpmath=sse -optc-msse2
> >* -optc-march=penti
Alistair_Bayley:
> > [mailto:[EMAIL PROTECTED] On Behalf Of Donald
> > Bruce Stewart
> >
> > 3) -fbang-patterns
> >
> > Better than `seq`
>
> Better in the "more convenient to write" sense, right? AFAIUI, seq and
> bang patterns should
conal:
>
>Lovely!
>
>Perhaps a stylistic shift would encourage writing this sort
>of elegant, fusion-friendly code.
>-- Generalized version of "interact". Encapsulates data
>getter & putter.
>genInteract :: IO i -> (o -> IO ()) -> ((i -> o) -> IO
>())
>
sic:
> * Andrew Coppin <[EMAIL PROTECTED]> [070608 02:45]:
> >Bayley, Alistair wrote:
> >
> > [[1]mailto:[EMAIL PROTECTED] On Behalf Of Andrew Coppin
> >
> > Donald Bruce Stewart wrote:
> >
> > Some things to remember using Dou
dons:
> sic:
> > * Andrew Coppin <[EMAIL PROTECTED]> [070608 02:45]:
> > >Bayley, Alistair wrote:
> > >
> > > [[1]mailto:[EMAIL PROTECTED] On Behalf Of Andrew Coppin
> > >
> > > Donald Bruce Stewart wrote:
> > >
> &
newsham:
> I wanted to point out:
>http://exitlist.torproject.org/
>
> written in Haskell. I haven't seen any announcements or info on this list
> (apologies if someone else mentioned it already). For the record, I'm not
> affiliated with the project in any way.
>
Is the source available
simonmarhaskell:
> Henning Thielemann wrote:
>
> >The program is compiled with GHC-6.4 and option -O2, CPU clock 1.7 GHz.
>
> ByteString is much faster with GHC 6.6, IIRC. We optimised the
> representation of ForeignPtr, and ByteString takes advantage of that. I
> recommend upgrading.
Yes, a
lemming:
>
> On Sun, 17 Jun 2007, Donald Bruce Stewart wrote:
>
> > simonmarhaskell:
> > > Henning Thielemann wrote:
> > >
> > > >The program is compiled with GHC-6.4 and option -O2, CPU clock 1.7 GHz.
> > >
> > >
eeoam:
> Bryan O'Sullivan wrote:
> >Eric wrote:
> >
> >>I'm writing a simple HTTP server and am trying to implement the POST
> >>method.
> >
> >That's a rather general problem statement, indeed :-) For an
> >application like this, I'd suggest that explicit resource management
> >is the way to
jeff:
> I've read the documentation for some of the marshalling packages out
> there for Haskell, and I'm left confused as to which one I should be
> using and how to actually do what I want to do. I have a file, a
> little over 2gb, of packed data in the format
>
> (recordcount) records of:
>
aeyakovenko:
> $ time ./md5sum ./md5sum
> [105,252,52,138,187,192,216,17,225,123,185,3,124,101,86,132]
>
> real0m4.790s
> user0m3.688s
> sys 0m0.492s
>
> $ time md5sum ./md5sum
> 69fc348abbc0d811e17bb9037c655684 ./md5sum
>
> real0m0.023s
> user0m0.000s
> sys 0m0.008s
>
dons:
> aeyakovenko:
> > $ time ./md5sum ./md5sum
> > [105,252,52,138,187,192,216,17,225,123,185,3,124,101,86,132]
> >
> > real0m4.790s
> > user0m3.688s
> > sys 0m0.492s
> >
> > $ time md5sum ./md5sum
> > 69fc348abbc0d811e17bb9037c655684 ./md5sum
> >
> > real0m0.023s
> > user
stefanor:
> On Wed, Jun 20, 2007 at 01:24:00PM +1000, Donald Bruce Stewart wrote:
> > aeyakovenko:
> > > $ time ./md5sum ./md5sum
> > > [105,252,52,138,187,192,216,17,225,123,185,3,124,101,86,132]
> > >
> > > real0m4.790s
> > > user
> > aeyakovenko:
> > > $ time ./md5sum ./md5sum
> > > [105,252,52,138,187,192,216,17,225,123,185,3,124,101,86,132]
> > >
> > > real0m4.790s
> > > user0m3.688s
> > > sys 0m0.492s
> > >
> > > $ time md5sum ./md5sum
> > > 69fc348abbc0d811e17bb9037c655684 ./md5sum
> > >
> > > real0m
dons:
> -- Fast md5 using OpenSSL and non-copying bytestrings
> md5sum :: B.ByteString -> String
> md5sum p = unsafePerformIO $ B.unsafeUseAsCStringLen p $ \(ptr,n) -> do
> digest <- c_md5 ptr (fromIntegral n) nullPtr
> liftM concat $ forM [0..15] $ \n -> do
>
aeyakovenko:
> i don't think its a problem with bytestrings. I strictly unpacked the
> bytestring and i still have 4 seconds for an md5 sum of the [word8]
Until someone writes an md5 on bytestrings, we can't really say how much
the slowdown is due to unpacking, GC and other memory stress building
ttmrichter:
>
>On Wed, 2007-20-06 at 15:21 +1000, Donald Bruce Stewart
>wrote:
>
> -- unsigned char *MD5(const unsigned char *d, unsigned long n, un
> signed char *md);
> foreign import ccall "openssl/md5.h MD5" c_md5
> :: Ptr CChar ->
jeff:
> Alright, I've been hacking away at what I posted the other day, and I
> have something that works for files that will fit entirely into memory.
> And then I figured out why I've been restricted to files that fit
> entirely into memory... One of my functions is causing the entire thing
> to
daniel.is.fischer:
> Am Donnerstag, 21. Juni 2007 10:22 schrieb Bayley, Alistair:
> > > [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Fischer
> > >
> > > I suppose in contrast to the version from HackageDB, which I
> > > got myself on
> > > monday, the darcs version works with ghc >= 6.6, or I
> >
bayer:
> I couldn't find a compile-time here document facility, so I wrote one
> using Template Haskell:
Very nice! You should wrap it in a little .cabal file, and upload it to
hackage.haskell.org, so we don't forget about it.
Details on cabalising and uploading here:
http://haskell.org/ha
jon:
> On Friday 22 June 2007 19:54:16 Philip Armstrong wrote:
> > On Fri, Jun 22, 2007 at 10:11:27PM +0400, Bulat Ziganshin wrote:
> > >btw, *their* measurement said that ocaml is 7% faster :)
> >
> > Indeed. The gcc-4.0 compilied binary runs at about 15s IIRC, but it's
> > still much better than
bf3:
> Wow thanks for all the info! This certainly can get me started.
>
> And yet I have some more questions (sorry!):
>
> - Unfortunately this project won't be open source; if my first tests are
> successful, I will try to convince my employer (who wants to develop such a
> graphical language)
> ...OK...so how do I make Haskell go faster still?
>
> Presumably by transforming the code into an ugly mess that nobody can
> read any more...?
>
http://haskell.org/haskellwiki/Performance
-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.o
andrewcoppin:
> Bulat Ziganshin wrote:
> >Hello Andrew,
> >
> >
> >definitive reading: "Tackling the awkward squad: monadic input/output,
> >concurrency, exceptions, and foreign-language calls in Haskell"
> >http://research.microsoft.com/Users/simonpj/papers/marktoberdorf/marktoberdorf.ps.gz
> >
hughperkins:
>
>Just noticed that all my responses have been going only to
>Neil, not to the group.
>Anyway, the jist of our conversation was that it's not
>possible to create arbitrary datatypes/constructors from
>strings in Haskell. Can anyone deny/confirm?
Entirely possib
gwern0:
> Hey everyone. So I've been learning Haskell for a while now, and I've
> found the best way to move from theory to practice is to just write
> something useful for yourself. Now, I'm keen on editing Wikipedia and
> I've long wanted some way to stop links to external websites from
> breakin
gracjanpolak:
>
> Hi all,
>
> I'm pleased to announce the first public release of Scripting.Lua.
>
> The package hslua-0.1 contains Haskell FFI bindings for a Lua interpreter
> along with some Haskell utility functions simplifying Haskell to Lua and
> Lua to Haskell calls. Full Lua interpreter i
chad.scherrer:
> I've never used sockets before, but I need to now, and I need to be
> able to get a lot of data quickly. I was thinking about doing
> something like this (below), but I'm wondering if there's a way that
> would be faster. Is the obvious way of doing this "the right way"? I'm
> happ
tittoassini:
> Hi,
>
> to load an Haskell symbol at run-time is still necessary to use the load
> functions from the hs-plugins library (System.Plugins.Load) or is there some
> function in the GHC API that does the same job?
>
yes, definitely possible. i think Lemmih put an example on the wiki
chad.scherrer:
> Ok, cool. FWIW, the current documentation for Network says:
>
> "For really fast I/O, it might be worth looking at the hGetBuf and
> hPutBuf family of functions in System.IO."
>
> But this looked pretty low-level to me, and I figured it might be outdated.
>
> I also know Bulat Z
bulat.ziganshin:
> Hello Donald,
>
> Wednesday, June 27, 2007, 6:37:07 AM, you wrote:
>
> >> I also know Bulat Ziganshin had put together a nice-looking Streams
> >> library (http://unix.freshmeat.net/projects/streams/) based on John
> >> Goerzen's previous HVIO work, but I wasn't sure if the Byt
tittoassini:
> On Wednesday 27 June 2007 03:06:15 Donald Bruce Stewart wrote:
> > tittoassini:
> > > Hi,
> > >
> > > to load an Haskell symbol at run-time is still necessary to use the load
> > > functions from the hs-plugins library (System.Plugins.Loa
clawsie:
> i have written a small haskell program to solve a problem many users
> of freebsd may have - knowing what ports have been updated after a
> daily/weekly etc cvsup. this is a trivial bit of coding hardly worth
> attention, but if it might be of use to you, you can find it here:
>
> http:
consalus:
> A while back I saw a toy tcl interpreter in 550 lines of C called
> 'picol'. I was looking for a simple language to implement in haskell,
> so I made my own toy tcl interpreter. It was surprisingly easy to
> make, thanks to the magic of Haskell and Bytestrings. :) It handles a
> few th
Interested in competing in the ICFP 2007 programming contest -- the
hackers contest of choice!
http://www.icfpcontest.org
There's 2000 people on this mailing list, and 350 people in #haskell, we
must be able to put together a few decent teams out of that talent
pool
To help people get o
aeyakovenko:
> So I tried implementing a more efficient sha1 in haskell, and i got to
> about 12 times slower as C. The darcs implementation is also around
> 10 to 12 times slower, and the crypto one is about 450 times slower.
> I haven't yet unrolled the loop like the darcs implementation does, s
aeyakovenko:
> inlining some of the functions definitely gave me a boost, so i am
> about 8.5 times slower then openssl sha1sum. I dont really understand
> the core output, but after inlining i got a completely different
> profile output, i am guessing its because the cost of the inlined
> functio
phil:
> On Sun, Jul 01, 2007 at 06:07:13PM +0100, Andrew Coppin wrote:
> >I haven't actually tried, but presumably a TCP connection is represented
> >in the same way as a file, and so has the same problems.
> >
> >Basically doing binary I/O seems to be one of those things that in Haskell
> >falls
drtomc:
> >Anyone trying to do any of this?
>
> I've done some work in this area. I'm particularly interested in
> manipulating ASN.1 in haskell. Actually, my first use of Parsec was an
> ASN.1 parser. I'd done one previously in Spirit (the Boost C++ rip-off
> of parsec), but semantic actions were
phil:
> On Wed, Jul 04, 2007 at 09:02:15PM +1000, Donald Bruce Stewart wrote:
> >phil:
> >>On Sun, Jul 01, 2007 at 06:07:13PM +0100, Andrew Coppin wrote:
> >>>I haven't actually tried, but presumably a TCP connection is represented
> >>>in the s
phil:
> On Wed, Jul 04, 2007 at 09:44:13PM +1000, Donald Bruce Stewart wrote:
> >Binary instances are pretty easy to write. For a simple data type:
> >
> > > instance Binary Exp where
> > > put (IntE i) = do put (0 :: Word8)
> >
dm.maillists:
> On Thursday 05 July 2007 11:20, Michael Vanier wrote:
> > Again, I'm sure this has been done before (and no doubt better); I'd
> > appreciate any pointers to previous work along these lines.
>
> Takusen is, if I recall correctly, based around a generalised fold supporting
> accumu
drtomc:
> On 7/4/07, Donald Bruce Stewart <[EMAIL PROTECTED]> wrote:
> >Can we do a cheap bytestring binding to libxml, to avoid any initial
> >String processing?
>
> For my part, it's not too big an issue. A version of HaXml or at least
> Parsec built on top
drtomc:
> I was explaining Haskell to a perl/python hacking friend recently and
> characterized things thus:
>
> Perl is a horrible language with fantastic libraries.
> Haskell is a fantastic language with horrible libraries.
>
> Actually, many of the libraries that exist for Haskell *are*
> fant
p.f.moore:
> On 05/07/07, Jonathan Cast <[EMAIL PROTECTED]> wrote:
> >Can't say I agree. I've been learning Python, and have been very
> >un-impressed
> >so far with its library coverage, which I would rate no better than (in
> >terms
> >of the POSIX bindings, worse than) Haskell.
>
> It probab
drtomc:
> On 7/6/07, Lukas Mai <[EMAIL PROTECTED]> wrote:
> >Hello, cafe!
>
> Have you been reading my mind? See the other recent Cafe thread (um,
> titled something about System.Exit).
>
> Here's my solution:
...
If you've got small examples illustrating how to use the various
concurrency abst
andrewcoppin:
> Jonathan Cast wrote:
> >On Thursday 05 July 2007, Andrew Coppin wrote:
> >
> >>...OK, anybody have a solution that works in Haskell 98?
> >>
> >
> >Rank-2 types are perhaps /the/ most common, widely accepted extension to
> >Haskell 98, after the approved addendum for FFI and
bf3:
> > but afair you don't yet have too much experience even with H98
> > language? from my POV, H98 as is useful for learning, but not for real
> > apps. there is wide common subset of GHC and Hugs language extensions
> > and this set (with exception for FD) will probably become new Haskell'
>
dons:
> bf3:
> > > but afair you don't yet have too much experience even with H98
> > > language? from my POV, H98 as is useful for learning, but not for real
> > > apps. there is wide common subset of GHC and Hugs language extensions
> > > and this set (with exception for FD) will probably become
ttmrichter:
>
>I've been wrestling the last few days with putting Haddock
>documentation into my code. After a dead-simple library
>failed to generate anything meaningful, I gave up, turfed my
>copy of Haddock and downloaded the latest from the web
>site. (Haddock 0.8, it see
felipe.lessa:
> >I've written it to run over lists, but it would not be difficult to
> >make it run over ByteStrings instead, and exploit the 'no-copying'
> >effect on the bits of the stream which were not modified, which would
> >be very handy for programs processing large bytestrings.
>
> I wond
trebla:
> Andrew Coppin wrote:
> >Personally, I just try to avoid *all* language extensions - mainly
> >because most of them are utterly incomprehensible. (But then, perhaps
> >that's just because they all cover extremely rare edge cases?)
>
> Haskell is an extremely rare edge case to begin with
trebla:
> Donald Bruce Stewart wrote:
> >Give #haskell is a far larger community than:
> >
> >#lisp
> >#erlang
> >#scheme
> >#ocaml
> >
> >As well as
> >
> >#java
> >#javascript
> >#ruby
>
andrewcoppin:
> Donald Bruce Stewart wrote:
> >Give #haskell is a far larger community than:
> >
> >#lisp
> >#erlang
> >#scheme
> >#ocaml
> >
> >As well as
> >
> >#java
> >#javascript
> >#ruby
&
ninegua:
> replying to my own message... the behavior is only when -O is used
> during compilation, otherwise they both run on 2 cores but at a much
> lower (1/100) speed.
Hmm, any change with -O2? Is the optimiser changing the code such that
the scheduler doesn't get to switch threads as often? I
Hackage hackers,
Looks like there's too many packages on hackage.haskell.org now for a
single page listing:
http://hackage.haskell.org/packages/archive/pkg-list.html
Perhaps we can have a page with just the categories, with subpages
hanging off?
-- Don
__
bulat.ziganshin:
> Hello Thomas,
>
> Sunday, July 8, 2007, 2:36:43 AM, you wrote:
> > This is certainly true. I've coded up in less than six months,
> > something that uses better algorithms and finer grained concurrency
> > than the software I used to work on, and the latter represented 5 or
> >
andrewcoppin:
>
> Does anybody have any clue why ByteStrings are actually faster? (And why
> this information isn't easily findable anywhere - must shorly be a VFAQ.)
>
It's well documented in the API documentation for bytestrings.
Start here:
http://www.cse.unsw.edu.au/~dons/fps/Data-Byte
andrewcoppin:
> Andrew Coppin wrote:
> >Dave Bayer wrote:
> >>I was beginning to accept that I might die before clearing my
> >>pipeline of research projects I want to code up. Haskell has given me
> >>new hope.
> >
> >Indeed. ;-)
> >
> >Today I hve implemented encoders and decoders for RLE, MTF,
andrewcoppin:
> I was wittering on about stream fusion and how great it is, and I got a
> message from Mr C++.
>
> (Mr C++ develops commercial games, and is obsessed with performance. For
> him, the only way to achieve the best performance is to have total
> control over every minute detail of
bulat.ziganshin:
> Hello apfelmus,
>
> Sunday, July 8, 2007, 5:20:18 PM, you wrote:
>
> >>> > Looks like there's too many packages on hackage.haskell.org now for a
>
> it's the nicest problem i can imagine :)
>
> > For browsing libraries, I like the wiki pages much more than hackage.
> > Can't
Jefferson Heard write:
> I'm using the Data.AltBinary package to read in a list of 4.8 million
> floats and 1.6 million ints. Doing so caused the memory footprint to
> blow up to more than 2gb, which on my laptop simply causes the program
> to crash. I can do it on my workstation, but I'd really
dons:
> Jefferson Heard write:
>
> > I'm using the Data.AltBinary package to read in a list of 4.8 million
> > floats and 1.6 million ints. Doing so caused the memory footprint to
> > blow up to more than 2gb, which on my laptop simply causes the program
> > to crash. I can do it on my workstati
Processing larger amounts of data, compression, serialisation and calling C.
An elaboration of the previous example:
* Build a largish structure in Haskell
* Compress it in memory
* Serialise it to disk
* Deserialise it
* Decompress
* Pass it to C
* Display the result
drtomc:
> I don't know if you saw the following linked off /.
>
> http://www.itwire.com.au/content/view/13339/53/
>
> An amazon link for the book is here:
>
> http://www.amazon.com/Computer-Science-Reconsidered-Invocation-Expression/dp/0471798142
>
> The basic claim appears to be that discrete
ketil:
> On Mon, 2007-07-09 at 10:30 +1000, Donald Bruce Stewart wrote:
>
> > Another idea I've been pondering is allowing people to add links to
> > documentation for libraries
>
> My main worry about Hackage is that it is often hard to tell the current
> stat
voigt:
> Hi,
>
> I can't get http://lambdabot.codersbase.com/ to work for me. Whatever
> input => "No lambdabot process"
>
> Is that a known issue, not the right URL, ...?
>
> Thanks,
> Janis.
Right URL, but Jason's not running lambdabot at the moment. You can
access our bot via IRC though. h
phil:
> On Mon, Jul 09, 2007 at 02:42:49PM +1000, Donald Bruce Stewart wrote:
> >Processing larger amounts of data, compression, serialisation and calling
> >C.
>
> Just a thought: is it worth sticking this up on the wiki?
http://ha
voigt:
> Donald Bruce Stewart wrote:
> >Right URL, but Jason's not running lambdabot at the moment. You can
> >access our bot via IRC though. http://haskell.org/haskellwiki/IRC_channel
>
> Yup, but I assume that would mean bothering others with my experiments
>
trebla:
> http://xkcd.com/c287.html
>
> import Data.Array
> import Control.Monad
>
> -- exactly n v
> -- items in v that sum to exactly n
> -- returns list of solutions, each solution list of items
> exactly :: (Real a) => a -> Array Int a -> [[a]]
> exactly 0 v = return []
> exactly n v = do
>
bayer:
> Learning Haskell, the Prelude.ShowS type stood out as odd, exploiting
> the implementation of lazy evaluation to avoid explicitly writing an
> efficient concatenable list data structure. This felt like cheating,
> or at least like using a screwdriver as a crowbar, to be less
> judg
sascha.boehme:
> Hello,
>
> > Who's our SoC hackage guy? To do list right here!
>
> The HackageDB project is for now concentrating on another subject. I see
> the necessity of adding search features and additionally tags, but in
> the moment I work on automatic generation of Haddock documentation
drtomc:
> Hi All,
>
> I notice that Data.ByteString has span and spanEnd. Is there a known
and break/breakEnd.
> particular reason why dropWhile and takeWhile don't have corresponding
> *End functions? If not, what is the protocol for adding them?
There's no reason -- we couldn't decide on whet
drtomc:
> Well, maybe I shoud be asking a higher level question then.
>
> I have a function
>
> tidy = reverse . dropWhile punk . reverse . dropWhile punk
>where
>punk = isPunctuation . chr . fromIntegral
>
> which is leading to a significant amount of allocation, and you can see why.
>
drtomc:
> So the following isn't as clever as the line-noise Don posted, but
> should be in the ball-park.
Low level loops are irksome, but guaranteed to be quick :P
> dropFromEnds p = dropWhile p . dropWhileEnd p
>
> dropWhileEnd p bs = take (findFromEndUntil (not p) bs) bs
>
> takeWhileEnd p
magnus:
> Continuing my "life up-side-down"? I'm looking for a Haskell wrapper
> around GPGME. Is there such a beast?
>
Don't think there's such a binding yet. Would make a good contribution
though!
-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@ha
lemming:
>
> On Tue, 10 Jul 2007, Donald Bruce Stewart wrote:
>
> > These smaller NP problems really love the list monad. here's roconnor's
> > solution from #haskell:
> >
> > import Control.Monad
> >
> > menu = [("Mixed Fruit&
tmorris:
> When you you use maybe :: b -> (a -> b) -> Maybe a -> b instead of
> pattern matching a returned Maybe value?
>
> Is there something a bit more concrete on this issue?
You mean, versus using 'case' or sugar for case?
It'll just inline to the same code.
For example:
maybe 10 (\n -
tmorris:
> Thanks Don,
> Is your explanation specific to maybe? Or does that apply to all functions?
>
> Suppose the following function for lists:
>
> f :: [a] -> b -> (a -> [a] -> b) -> b
>
> ...instead of pattern matching [] and (x:xs)
It really depends on the body of 'f'. If they're simple w
lemming:
>
> On Tue, 10 Jul 2007, Tony Morris wrote:
>
> > Is your explanation specific to maybe? Or does that apply to all functions?
> >
> > Suppose the following function for lists:
> >
> > f :: [a] -> b -> (a -> [a] -> b) -> b
> >
> > ...instead of pattern matching [] and (x:xs)
>
> A foldr
jcast:
> I was just meditating on array fusion using streams, and list fusion using
> streams, and it struck me: the definition of the list functions over arrays
> is the same as that of the list functions over lists. From the ByteString
> paper, we get:
Yes indeed, hence Data.Stream provides
allbery:
>
> On Jul 10, 2007, at 16:07 , Alex Queiroz wrote:
>
> >As I replied to Hugh, the Universe of computers is not restricted
> >to PCs. We, embedded developers, will be using C for a lot of time
> >still.
>
> Doesn't nhc98 target embedded devices?
It's been used on embedded arm devic
walter1003:
>
>Hi all,
>
>I will soon be doing my last year in computer science.
>One part of our last year encompasses quite a big project
>which will
>go over 3 terms and will account for 3 modules (45 credits).
>I was thinking in doing something using functional languag
jeff:
> I switched to Data.Binary, which dropped me from 2.6GB to 1.5GB, and
> then I switched this afternoon to unboxed arrays from lists of floats,
> and that dropped me again from 1.5GB to 475MB. I think, all told, that
> I'm in an acceptable range now, and thank you for pointing out the
> libr
jeff:
> I switched to Data.Binary, which dropped me from 2.6GB to 1.5GB, and
> then I switched this afternoon to unboxed arrays from lists of floats,
> and that dropped me again from 1.5GB to 475MB. I think, all told, that
> I'm in an acceptable range now, and thank you for pointing out the
> libr
Looks like the spam protection measures are breaking down a bit. There's
been 4 spam incidents (at least) on the wiki in the past day. Ashley et
al, is there any easy fix?
-- Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.
lennart:
>
>Yes, I think we want Integer to be the type that is used
>unless you ask for something else.
>It adheres to the principle of getting it right before
>optimizing.
On a similar note, there's been a long discussion in #haskell about the
problems of defaulting to floating
simon:
> Great - indeed,
>
> > sum [1.85, 5.95, -7.80]
> 8.881784197001252e-16
> > sum [1.85::Money, 5.95, -7.80]
> 0.00
>
> I'm not yet sure these will do the best thing in all arithmetic, but it
> seems to be the right thing for now.
>
> Yes, I will need to read these also. Perhaps first read
1 - 100 of 661 matches
Mail list logo