Maybe something of these?
http://www.haskell.org/haskellwiki/Blow_your_mind
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman
without
even requiring the length of the list to be known in advance, that
could lead to a solution.
Thanks,
Chad
On 8/15/07, Paul Johnson [EMAIL PROTECTED] wrote:
Chad Scherrer wrote:
There's a problem I've been struggling with for a long time...
I need to build a function
buildSample
Funny you should say that, I was just experimenting with generating
one at a time using (StateT StdGen Maybe). If I get stuck (again) I'll
check out ListT. Thanks!
Chad
On 8/15/07, Paul Johnson [EMAIL PROTECTED] wrote:
Chad Scherrer wrote:
Thanks for your replies.
I actually starting out
isn't so
well studied, the bulk of the work is in finding the right
abstraction, which forces generalization beyond what would otherwise
be needed (though it'll be easier the next time!).
On 8/15/07, Paul Johnson [EMAIL PROTECTED] wrote:
Chad Scherrer wrote:
Funny you should say that, I
from the GC. Or
maybe it's a strictness/laziness issue I'm missing. Still not so sure
when I need case vs let/where.
How would you guys going about tracking down the problem?
Thanks,
Chad
On 8/15/07, Paul Johnson [EMAIL PROTECTED] wrote:
Chad Scherrer wrote:
Thanks for your replies.
I
Depends: libghc6-cairo-dev but it is not going to be installed
Do any of you guys know why this wouldn't include a newer version? Probably
just an oversight, I'm guessing.
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
Big_Ham joymachine2001 at hotmail.com writes:
Is there a library function to take a list of Strings and return a list of
ints showing how many times each String occurs in the list.
So for example:
[egg, egg, cheese] would return [2,1]
I couldn't find anything on a search, or
Hmm, is insertWith' new? If I remember right, I think the stack overflows
were happening because Map.insertWith isn't strict enough. Otherwise I think
the code is the same. But I would expect intTable to be faster, since it
uses IntMap, and there's no IntMap.insertWith' as of 6.6.1 (though it may
Hi,
I'd like to be able to use Data.Binary (or similar) for compression.
Say I have an abstract type Symbol, and for each value of Symbol I
have a representation in terms of some number of bits. For compression
to be efficient, commonly-used Symbols should have very short
representations, while
A while back I was playing with Data.Map was getting irritated about
lookups that fail having the type of values, but wrapped in an extra
monad. I decided to work around this by putting a default in the data
type itself, so we have a functional map
data FMap k a = FMap (k - a) (Map k a)
This has
Chad Scherrer chad.scherrer at gmail.com writes:
A while back I was playing with Data.Map was getting irritated about
lookups that fail having the type of values, but wrapped in an extra
monad. I decided to work around this by putting a default in the data
type itself, so we have
Roman Leshchinskiy rl at cse.unsw.edu.au writes:
Ah. I missed that. Then your best bet is probably
replicate n action = munstream v $ Fusion.Stream.Monadic.generateM n (const
action)
$ new n
It's uglier that it should be but vector simply doesn't define
Hello cafe,
I'm trying to do some things with bounded indices so I can carry
around arrays (well, Vectors, really) without needing to refer to the
bounds.
For example, if I know my indices are Bool values, I can do
rangeSize (minBound, maxBound :: Bool)
2
I'd like to be able to do this in
On Thu, 22 Jul 2010, Chad Scherrer wrote:
I thought it might help to put it into a module and do a better job
with the type, like this:
bdRangeSize :: (Ix i, Bounded i) = i - Int
bdRangeSize _ = rangeSize (minBound, maxBound :: i)
Henning Thielemann lemming at henning-thielemann.de
On Thu, Jul 22, 2010 at 3:43 PM, Daniel Fischer
daniel.is.fisc...@web.de wrote:
{-# LANGUAGE ScopedTypeVariables #-}
bdRangeSize :: forall i. (Ix i, Bounded i) = i - Int
Ah nice, I tried a forall in that position, but I didn't know about
ScopedTypeVariables. Thanks!
Chad
Philip,you wrote:-I am trying to learn Haskell. As an exercise, I wrote afunction to create a binary tree in level-order. I am attaching
the code. I am sure there are a number of places wherethe code could be
Ok, so I'm doing things somewhat backward. I've been using Haskell for
a while now, whenever I get a chance to. But in order to become more
involved in high-performance computing projects at my work, I need to
learn C.
I've heard a lot of people say that experience in Haskell can improve
one's
Subject: Re: [Haskell-cafe] Learning C after HaskellTo: Chad Scherrer [EMAIL PROTECTED]hi,C is very different from Haskell.* you'lle have to manage explicitly memory de/allocation.
* c programming is a bit like haskell io monad programming (butwithout the functionnal part) :you'lle use = in place
Thanks for all the replies - this has helped a lot!
ChadOn 6/12/06, Chad Scherrer [EMAIL PROTECTED] wrote:
Ok, so I'm doing things somewhat backward. I've been using Haskell for
a while now, whenever I get a chance to. But in order to become more
involved in high-performance computing projects
Then I should be thanking Duncan as well (thanks!). I had seen the array fusion idea before in the NDP work, but I hadn't thought of applying to this area. I wonder where else the concept might apply? Is there a typeclass to be built?
-- Chad ScherrerTime flies like an arrow; fruit flies like a
Hi,
I'm interested in attending the Hackathon, but I don't have any
previous experience working on compilers. I think it could be a great
learning experience, but I certainly don't want to slow progress on any
work by just hanging around asking questions. I'm a
mathematician/statistician, and my
Yep, that's its codename.
Now, I'm not much of a Windows person. Is the name just a weird
coincidence, or does it have anything to do with monads as we know
them?
http://en.wikipedia.org/wiki/MSH_(shell)
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
yet, and already the
mainstream-to-be is taking over the google results. Googling for
microsoft monad gives all powershell and no MS Research!
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
___
Haskell-Cafe mailing
Now and again I see references to deepSeq, and I've never understood
how this could be any different than using rnf from
Control.Parallel.Strategies. Is there really any difference? When is
it better to use one or the other?
Thanks,
--
Chad Scherrer
Time flies like an arrow; fruit flies like
maybe I needed to replace 1 with (1 :: Int) so the state
representation didn't force the type, but it still gives the same
result.
Can someone point me to the simplest possible runST example that
actually works? Thanks!
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana
Whoa. That changes everything I thought I knew about ($). Come to
think of it, one of the examples that does work it written
main = print $ runST f
where f is defined separtely. So that's consistent.
I'll take a look at the references. Thanks!
Indeed. The short answer: use
runST (long
mapM_ (x0 +=) xs
x0
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Are the types of (result x) and result' not exactly the same?
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
The IO monad hasn't given me too much trouble, but I want to be sure
to structure things the way they should be. If I get everything
running using IO first and then have type-checking problems with ST,
it will be tempting to just slap on an unsafePerformIO and call it
good. Sure, it's really
! Of course there is no problem
if you don' use the higher order function $. Use parens instead
x = runST (return 1)
Simon
| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
| Chad Scherrer
| Sent: 19 July 2006 23:02
| To: haskell-cafe@haskell.org
not just do
something like this (in ghci)?
Prelude let sq x y = if x == x then y else y
Prelude 1 `sq` 2
2
Prelude (length [1..]) `sq` 2
Interrupted.
There must be a subtlety I'm missing, right?
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
There must be a subtlety I'm missing, right?
What if the types are not instances of Eq?
Jason
Thanks, I figured it was something simple. Now I just to convince
myself there's no way around that. Is there a proof around somewhere?
--
Chad Scherrer
Time flies like an arrow; fruit flies
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Hang on, hang on, now I'm getting confused.
First you asked for the smallest (positive) x such that
1+x /= x
which is around x=4.5e15.
Then Joachim wondered if you wanted
1+x /= 1
which is around x=2.2e-16.
But not you claim to be looking for the smallest positive number that
a Double
Tamas,
try
scanl (+) 0
for the cumulative sum
From there the zipWith idea you mentioned seems like the way to go.
-Chad
Hi,
I have two lists, p and lambda (both are finite). I would like to
calculate
1) the cumulative sum of lambda, ie if
lambda = [lambda1,lambda2,lambda3,...]
then
I'm trying to use Data.Time, and I'm totally confused. DiffTime is
abstract, and I don't see anything that maps into it. How do I
construct one? I would like to then use the result to create a value
of type UTCTime, but it seems (currently) like this might be easier.
Thanks,
--
Chad Scherrer
Ok, that's much simpler than I was making it. fromIntegral or
fromRational does the trick. Obvious in hindsight, I guess. Thanks!
-Chad
On 10/2/06, Ashley Yakeley [EMAIL PROTECTED] wrote:
Chad Scherrer wrote:
I'm trying to use Data.Time, and I'm totally confused. DiffTime is
abstract, and I
missing, but it seems to me they're
basically the same.
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Interesting, I hadn't thought of the SYB approach. I still need to get
through those papers. Actually, I wonder if this idea would help with
something else I was looking into. It seems like it might occasionally
be useful to have a monad that is the identity, except that it forces
evaluation as
Hello,
I've written some code that does a foldl (or scanl, depending on my
mood) kind of thing, and builds a huge tree structure as it goes
along. I've been careful to make inserts as strict (and eager) as
possible, since I know all the pieces will be evaluated eventually
anyway. Now I'd like to
On 10/28/06, Tomasz Zielonka [EMAIL PROTECTED] wrote:
On Fri, Oct 27, 2006 at 06:28:58AM -0700, Chad Scherrer wrote:
Should I expect a monadic version to take a performance hit? What if I
use some SPECIALIZE pragmas or somesuch? Is it more efficient to write
one from scratch, or do specific
Lemmih wrote:
Using 'seq' is generally a bad idea. It can worsen the performance if
not used carefully and GHCs strictness analyser is usually good
enough.
Is GHC.Conc.pseq any better? Usually the whole point of making things
more strict is to optimize performance for pieces you know will be
the role of the strictness analysis step. But being able
to easily make things really strict seems pretty important, and there
seem to be a lot of subtleties to using seq that make it difficult to
tune for performance.
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho
for program
transformation and derivation from specification (Bird-Meertens
formalism)
The only disadvantage I know of is that it can lead to obfuscation,
especially if Haskell hasn't twisted your brain yet (in a good way).
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana
When using MVars, is there a reason to prefer using MVar (a,b) over
(MVar a, MVar b), or vice versa? I'm not sure if this is really a
question of style, or if there are practial implications I'm missing
one way or another. Thanks!
--
Chad Scherrer
Time flies like an arrow; fruit flies like
invariants that span the two? Put
operationally, do you want different threads to be able to access a
and b concurrently?
-m
Chad Scherrer [EMAIL PROTECTED] writes:
When using MVars, is there a reason to prefer using MVar (a,b) over
(MVar a, MVar b), or vice versa? I'm not sure if this is really
Hi,
I'd like to be able to use randomIO, but I'm working within the
context of STM. Is there a way to get these working together happily?
For now, I guess I could kludgingly use unsafePerformIO inside STM
(it's the other way around that's not allowed, right?), but I would
need to be sure it
Wow, lots of great ideas. Thanks, guys.
Lemmih,
I worry about the uncertainty in the semantics that seems to be
introduced by the unsafe stuff. But I actually hadn't noticed
GHC.Conc.unsafeIOToSTM before, so it's good to know it's there.
Rich,
Even if I use randomIO outside the STM code, I
testing with this beyond type checking, but it seems like
it could be useful for similar cases to newTVarIO. Has anyone else played
with anything similar?
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
___
Haskell-Cafe
Are (a - [b]) and [a - b] isomorphic? I'm trying to construct a function
f :: (a - [b]) - [a - b]
that is the (at least one-sided) inverse of
f' :: [a - b] - a - [b]
f' gs x = map ($ x) gs
It seems like it should be obvious, but I haven't had any luck with it yet.
Any help is greatly
in
this context.
On 2/2/07, Yitzchak Gale [EMAIL PROTECTED] wrote:
Chad Scherrer wrote:
Are (a - [b]) and [a - b] isomorphic? I'm trying to construct a function
f :: (a - [b]) - [a - b]
that is the (at least one-sided) inverse of
f' :: [a - b] - a - [b]
f' gs x = map ($ x) gs
Anything
Maybe a year or so ago, I came across a tool for Haskell that takes a
collection of modules, does some name-mangling, and gives a single
module that only needs to export main. There were wonderful reductions
in the size of the resulting executable, and potentially more
optimizations available to
Tom,
I think inserting elements would be a lot faster than multiple unions.
I would try:
leafList :: Tree - [Int]
leafList (Leaf n) = [n]
leafList (Branch left right) = leafList left ++ leafList right
leaves = fromList . leafList
If you're writing many functions on Trees (or maybe even if
Neil,
I think this idea is better than what I had suggested, but as it
stands it doesn't typecheck. Did you mean something like this?
leaves :: Tree - [Int]
leaves = f []
where
f rest (Leaf n) = n : rest
f rest (Branch l r) = f (f rest r) l
-Chad
---
Hi Tom,
Tom Hawkins wrote:
Folding was my first approach:
leaves :: Tree - Set Int
leaves tree = accumLeaves Set.empty tree
accumLeaves :: Set Int - Tree - Set Int
accumLeaves set (Leaf n) = insert n set
accumLeaves set (Branch l r) = foldl accumLeaves set [l,r]
However, with this approach I
if
possible.
Thanks!
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
On 2/28/07, Dan Weston [EMAIL PROTECTED] wrote:
GSL is written in C, and I don't know any language more portable than
that! gsl_vector and gsl_matrix use a continuous block of doubles, so
you can use the FFI to marshall this however you want for efficiency.
I'd stick with GSLHaskell until
of this
subsumed by fusion anyway?
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Careful. ByteString is an alternative to [Word8]. Converting [Char] to
ByteString and back requires an encoding. (Unfortunately, the only encoding
that comes with the bytestring package is lossy.)
Ahh, good point. I guess I almost always just use them to read ASCII,
so it hasn't been an issue.
Given a reasonable Storable instance of pairs you could use:
http://code.haskell.org/~sjanssen/storablevector
I hadn't seen that before, thanks!
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Hello haskell-cafe,
In ghci, I tried to get info for Data.Stream.Stream:
$ ghci
GHCi, version 6.8.2: http://www.haskell.org/ghc/ :? for help
Loading package base ... linking ... done.
Prelude :m Data.Stream
Prelude Data.Stream :i Stream
data Stream a where
Stream :: forall a s.
On Feb 8, 2008 9:55 AM, Simon Peyton-Jones [EMAIL PROTECTED] wrote:
I have not been following closely but if Don thinks there's a bug there
probably is. Can someone submit a bug report pls? Better still a patch! :-)
Simon
Ok, I filed a bug report.
ByteStrings have given a real performance boost to a lot of Haskell
applications, and I'm curious why some of the techniques aren't more
abstracted and widely available. If it's because it's a big job,
that's certainly understandable, but maybe there's something I'm
overlooking that some of the
On Feb 17, 2008 4:13 PM, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote:
Have you looked at the stream-fusion package on Hackage?
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/stream-
fusion-0.1.1
Yeah, I've seen this. It's nice that this is separated, but a little
unsatisfying
they currently use two different fusion systems. bytestring uses an
older version of what is now stream fusion. at some point we'll switch
bytestrings over to using the new stuff in the stream-fusion package,
since its a lot better.
Oh, that's pretty interesting. I had assumed bytestring had
On Feb 17, 2008 5:01 PM, Don Stewart [EMAIL PROTECTED] wrote:
yeah, with lists, as compared to bytestrings, there are:
* more complex operations to fuse
* allocation is much cheaper (lazy list cons nodes)
* built in desugaring for build/foldr fusion interferes (enumerations,
On Feb 17, 2008 6:06 PM, Derek Elkins [EMAIL PROTECTED] wrote:
It's -quite- possible that a coalgebraic perspective is much more
natural for your code/problem. If that's the case, use it (the
coalgebraic perspective that is). Obviously depending on the internals
of the stream library is not
Henning Thielemann lemming at henning-thielemann.de writes:
4) We are missing one final useful type: a Word32-based ByteString.
When working in the Unicode character set, a 32-bit character
can indeed be useful, and I could see situations in which the
performance benefit of a
On Feb 20, 2008 10:57 AM, Antoine Latter [EMAIL PROTECTED] wrote:
For anyone looking into it - the StorableVector fusion would have to
be quite different from the current ByteString fusion framework.
Maybe it would be enough to lay down a Stream fusion framework for
StorableVectors.
I must be
Antoine Latter [EMAIL PROTECTED] wrote:
From what I saw of Data.ByteString.Fusion, it relies on the assumption
that the elements of the output array are of the same size and
alignment as the elements of all of the arrays in the fused
intermediate steps. That way, all of the intermediate
On Wed, Feb 20, 2008 at 5:53 PM, Roman Leshchinskiy [EMAIL PROTECTED] wrote:
In general, I don't see why programming directly with streams is
something that should be avoided. You do have to be quite careful,
though, if you want to get good performance (but GHC's simplifier is
becoming
On Wed, Feb 20, 2008 at 7:57 PM, Henning Thielemann
[EMAIL PROTECTED] wrote:
I think there can also be problems simply because the element type is no
longer fixed to Word8 but also not entirely free, but restricted to
Storable. E.g. you cannot simply replace
SV.fromList . List.map f
Jens Blanck jens.blanck at gmail.com writes:
{-# LANGUAGE MagicHash #-} import GHC.Exts import Data.Bits -- experiment
with using a LUT here (hint: FFI + static arrays in C)
...
Sorry I don't have an answer, only more questions.
Is {-# LANGUAGE MagicHash #-} documented somewhere? I've seen
Imam Tashdid ul Alam uchchwhash at yahoo.com writes:
A few days back, I *think* I stumbled upon the
statement the interaction between GADTs and
functional dependencies is not yet well understood.
Then I glossed over it. Now that I have (finally)
started understanding what GADTs are meant to
Don Stewart dons at galois.com writes:
[interesting quote...]
Which I think really captures the joy of being able to write algebraic
and data structure transformations, via rewrite rules, without having to
extend the compiler -- all thanks to purity, laziness, and static
typing.
This makes me
My work uses WebSense to filter viewable pages - I don't have an option.
I used to be able to get to darcs.haskell.org just fine, but apparently a
/hacking directory was added somewhere, so WebSense put it on the naughty list.
I put in a request for WebSense to review the site; hopefully it will
Jed Brown jed at 59A2.org writes:
Uh, ByteString is Unicode-agnostic. ByteString.Char8 is not. So why not do
IO
with lazy ByteString and parse into your own representation (which might look
a
lot like StorableVector)?
One problem you might run into doing it this way is if a wide
Duncan Coutts duncan.coutts at worc.ox.ac.uk writes:
On Thu, 2008-05-29 at 18:12 +, Chad Scherrer wrote:
I used to be able to get to darcs.haskell.org just fine, but apparently a
/hacking directory was added somewhere, so WebSense put it on the naughty
list.
Do you know where?
Neil
.
Or, if you're using ghci, you could just do
s - load
parse s
This is because ghci executes in the IO monad (maybe there are some
details of this I'm missing, but that's how I think of it anyway.
BTW, your load function could be equivalently written simply as
load = readFile parse.hs
-Chad
://haskell.org/haskellwiki/Library/Streams and download it as
http://freearc.narod.ru/Streams.tar.gzfrom a thread in February entitled:Streams: the extensible I/O library (Feb 21)Googlesite:haskell.org bulat extensible I/O library for the thread, etc.
Hope that helps,Jared.On 5/19/06, Chad Scherrer
On 5/20/06, Donald Bruce Stewart [EMAIL PROTECTED] wrote:
Data.ByteString is in the base libraries now.For a bit of the flavour, see:http://haskell.org/haskellwiki/Wc
In this message
http://article.gmane.org/gmane.comp.lang.haskell.general/13625
Bulat says,
i foresee that Streams + Fast Packed
Hello,
I need to be able to use strict bytestrings to efficiently build a
lazy bytestring, so I'm using putByteString in Data.Binary. But I also
need random numbers, so I'm using mwc-random. I end up in the IO Put
monad, and it's giving me some issues.
To build a random document, I need a random
Chad Scherrer chad.scherrer at gmail.com writes:
Second attempt:
doc :: IO Put
doc = docLength = go
where
go 1 = word
go n = do
w - word
ws - go (n-1)
return (w putSpace ws)
This one actually works, but it holds onto everything in memory
instead of outputting
Don Stewart dons at galois.com writes:
Some choice quotes:
almost all of the examples of Haskell's use in industry are fakes
nobody has ever done anything significant using Haskell
Jon's the primary source of FUD against Haskell and its community, as he
goes around promoting his
T Willingham t.r.willingham at gmail.com writes:
I am thinking of our troglodytic friend 'make', which will run (for
example) 4 parallel jobs when given the option make -j4. Even
'rake', the ruby version of make, now has a branch (called drake)
which does the parallel -j option.
From the
to avoid that. Any
ideas?
BTW, I probably should be using ST for this, but I hit the usual type s
escapes irritation and gave up. If that would work more easily, that would be
fine with me too.
Thanks!
Chad Scherrer
___
Haskell-Cafe mailing list
Haskell
Don Stewart dons at galois.com writes:
Hmm. So you'd need to construct a new IntMap, made by fmap'ping
unsafeFreeze over each element of the old map.
I guess if we had a Traversable instance for Data.IntMap things would be just
fine. Would this be a bad thing in any way?
Chad
Don Stewart dons at galois.com writes:
Hmm. So you'd need to construct a new IntMap, made by fmap'ping
unsafeFreeze over each element of the old map.
For now I'll just do
IntMap.map (unsafePerformIO . unsafeFreeze)
Hopefully this won't come back to bite me
Thanks!
Chad
Brian,
I had this exact problem, and I found this approach to work wonderfully:
http://pupeno.com/2006/12/17/unstable-packages-on-ubuntu/
Chad
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
In John Hughes's Programming With Arrows
(http://www.cs.chalmers.se/~rjmh/afp-arrows.pdf), he discusses a
stream function type
newtype SF a b = SF {runSF :: [a] - [b]}
and gives
instance Arrow SF where
He gives some examples using this, and everything seems to go just fine.
But in Ross
String] - IO (Matrix Double).
--
Chad Scherrer
Time flies like an arrow; fruit flies like a banana -- Groucho Marx
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
What do you think of this plan? Are there features/bug-fixes that you really
want to see in 6.8?
I'm most anxious for parallel GC - do you think it will be another
release or two before this is a reality?
Thanks,
Chad
___
Haskell-Cafe mailing list
I've gotten into a habit of preceding most dos in my code with a
$, and indenting the next line. I kind of like this, since it makes
the indentation more uniform. But it seems to have bitten me now. I'd
like to write something like this
s = sum $ do
x - [1,2,3]
let b = sum $ do
y - [0..x +
of the original code,
where sum [0.. x+1] wasn't an option.
-Chad
On 5/17/07, David House [EMAIL PROTECTED] wrote:
On 17/05/07, Chad Scherrer [EMAIL PROTECTED] wrote:
But GHC complains of Empty 'do' construct.
Because it takes the indented following lines as being new bindings in
the let-block
Is (^2) really considered currying? As I understand it, this is
syntactic sugar for a section, and might confuse the issue a bit,
since it's distinct from ((^) 2). In this case we would have something
like
Prelude let pow2 = ((^) 2)
Prelude map pow2 [1..10]
[2,4,8,16,32,64,128,256,512,1024]
I
On 5/23/07, Philippa Cowderoy [EMAIL PROTECTED] wrote:
On Wed, 23 May 2007, Chad Scherrer wrote:
Is (^2) really considered currying? As I understand it, this is
syntactic sugar for a section, and might confuse the issue a bit,
since it's distinct from ((^) 2).
Sure, but it's (flip (^)) 2
Haskell is great at manipulating tree structures, but I can't seem to
find anything representing a directory tree. A simple representation
would be something like this:
data Dir = Dir {dirName :: String, subDirectories :: [Dir], files :: [File]}
data File = File {fileName :: String, fileSize ::
On 6/22/07, Jeremy Shaw [EMAIL PROTECTED] wrote:
Hello,
Have you seen Tom Moertel's series on directory-tree printing in Haskell ?
No, I hadn't. Might be just the ticket. Thanks!
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Nice, thanks! Certainly looks like a good start at this.
What got me thinking about this is I'd like to be able to do something
like this in just a couple lines of code:
gunzip -c ./2*/*.z
... and feed the result into a giant lazy ByteString. Now, the UNIX
command doesn't really cut it,
Thanks, Bryan, this is much cleaner than the imperative hack I was
throwing together. And aside from the imports, it even fits the
couple lines of code criteria! Wonderful.
I won't be able to try this out until I get back to work, but I'm
wondering whether this will handle a few thousand files.
1 - 100 of 115 matches
Mail list logo