[Haskell-cafe] zlib build failure on recent GHC

2011-11-07 Thread Ben Gamari
s in question seem to be valid Does this seem like a compiler issue to you? Cheers, - Ben [1] http://hackage.haskell.org/trac/ghc/ticket/5610 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Time zones and IO

2011-11-06 Thread Ben Gamari
itrary (through timezone-olson) as well the current timezone? It seems like this would be inconvenient and overkill, however. Ideas? - Ben [1] https://github.com/hellertime/time-recurrence/blob/master/src/Data/Time/CalendarTime/CalendarTime.hs#L92 ___ Haske

Re: [Haskell-cafe] Efficient mutable arrays in STM

2011-10-30 Thread Ben Franksen
would probably be ok, (no need to evaluate it, since the closure is newly allocated, thus a new object), a little more on the safe side is a new TVar i.e. use TVar (TVar ()). Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Efficient mutable arrays in STM

2011-10-25 Thread Ben Franksen
Ketil Malde wrote: > Ben Franksen writes: > >> An array of TVars is certainly *much* too inefficient for what I have in >> mind w.r.t. both memory and cpu time. > > You must be a lot more confident than I if you say this without > benchmarking first. :-) Ok, n

Re: [Haskell-cafe] Efficient mutable arrays in STM

2011-10-25 Thread Ben Franksen
David Barbour wrote: > On Tue, Oct 25, 2011 at 10:47 AM, Ben Franksen > wrote: > >> The main question is: does the STM transaction actually "see" that I >> changed > > part of the underlying array, so that the transaction gets re-tried? Or do > I >&g

[Haskell-cafe] Efficient mutable arrays in STM

2011-10-25 Thread Ben Franksen
e an internal API for the STM stuff, i.e. a C header file or something which would make it possible to add efficient TArrays? Or should I use a high-level approach, something like a Data.Sequence.Seq of medium sized chunks (TVar (IOVector e))? Any comments are highly appreciated! Cheers Ben ___

Re: [Haskell-cafe] Parsec line number off-by-one

2011-09-21 Thread Ben Gamari
On Wed, 21 Sep 2011 09:37:40 +0300, Roman Cheplyaka wrote: > Hi Ben, > > This is indeed a bug in parsec. > Ahh good. I'm glad I'm not crazy. Given that it seems the lookahead is actually unnecessary, looks like I can skip the patch too. Thanks for your

Re: [Haskell-cafe] Parsec line number off-by-one

2011-09-21 Thread Ben Gamari
ould call it > after every real atom and after your formatDecl (so before your linesOf > parser). > Excellent solution. I appreciate your help. That would have taken me quite a bit of head-banging to find. Cheers, - Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Parsec line number off-by-one

2011-09-20 Thread Ben Gamari
from the fact that I use "try" to accomplish this but this is as far as I can reason. Any ideas what might cause this sort of off-by-one? Does anyone see a better (i.e. working) way to formulate my grammar? Any and all help would be greatly appreciated. Thanks. Cheers, - Ben module

Re: [Haskell-cafe] matrix manipulations and calculations

2011-09-09 Thread Ben
patrick perry has a nice binding to some of BLAS and LAPACK https://github.com/patperry/hs-linear-algebra it's been a while but i think it uses Vector. hope he doesn't mind me publicizing it! b On Sep 9, 2011, at 6:23 AM, Stefan Kersten wrote: > On 9/9/11 1:44 PM, Aleksey Khudyakov wrote: >>

Re: [Haskell-cafe] Smarter do notation

2011-09-04 Thread Shachaf Ben-Kiki
On Sat, Sep 3, 2011 at 19:34, Daniel Peebles wrote: ... > Of course, the fact that the return method is explicitly mentioned in my > example suggests that unless we do some real voodoo, Applicative would have > to be a superclass of Monad for this to make sense. But with the new default > supercla

Re: [Haskell-cafe] Bug in GC's ordering of ForeignPtr finalization?

2011-08-28 Thread Ben Gamari
; together in a record type. > In this case I wouldn't be able to reproduce the problem with optimization disabled, no? Unfortunately, this is not the case; the problem persists even with -O0. - Ben ___ Haskell-Cafe mailing list Haskell-Cafe@hask

[Haskell-cafe] Bug in GC's ordering of ForeignPtr finalization?

2011-08-28 Thread Ben Gamari
On Tue, 16 Aug 2011 12:32:13 -0400, Ben Gamari wrote: > It seems that the notmuch-haskell bindings (version 0.2.2 built against > notmuch from git master; passes notmuch-test) aren't dealing with memory > management properly. In particular, the attached test code[1] causes >

Re: [Haskell-cafe] (Repa) hFlush: illegal operation

2011-08-24 Thread Ben Lippmeier
urce data is several GB in size, if you make a test file with mostly zeros it should gzip down to nothing. Also, what is the native form of the data you are using? If it's in some standard binary form it may just be easier to write a native Repa loader for it. Cheers, Ben. ___

[Haskell-cafe] Memory management issue in notmuch-haskell bindings

2011-08-16 Thread Ben Gamari
ges object holding a reference. Any idea what might have gone wrong here? Thanks! Cheers, - Ben [1] Test case, import Data.List import Control.Monad import System.Environment import Foreign.Notmuch dbpath = "/home/ben/.mail" getAddresses :: Database -> String -> IO [String]

Re: [Haskell-cafe] Fwd: shootout

2011-08-03 Thread Ben Gamari
2.1GHz. I'm honestly not sure why performance doesn't improve with two threads, but I think I've made the point. - Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] logic and types

2011-07-31 Thread Ben Lippmeier
an define a type class, but not give instances for it, and still write functions using the type class methods. > -- I am not sure of the respective roles of => and -> in a logical context Once again, "which logic?". The type system that checks GHC core is itself a logical sy

[Haskell-cafe] Fwd: shootout

2011-07-30 Thread Ben
hello cafe-istas -- for those of you who are into these things, a lot of the shootout programs are suffering from "make errors" and thus do not have benchmarks. http://shootout.alioth.debian.org/u64q/haskell.php best, ben Begin forwarded message: > From: Don Stewart > Date:

[Haskell-cafe] Haskell Implementors Workshop talk proposals due this Friday!

2011-07-19 Thread Ben Lippmeier
(Portland State University) * Ben Lippmeier - co-chair (University of New South Wales) * Andres Loeh (Well-Typed LLP) * Oleg Lobachev(University of Marburg) * Neil Mitchell - co-chair (Standard Chartered) * Dimitrios

[Haskell-cafe] Haskell Implementors Workshop 2011, Second CFT

2011-07-04 Thread Ben Lippmeier
(Portland State University) * Ben Lippmeier - co-chair (University of New South Wales) * Andres Loeh (Well-Typed LLP) * Oleg Lobachev(University of Marburg) * Neil Mitchell - co-chair (Standard Chartered) * Dimitrios

Re: [Haskell-cafe] Can it be proven there are no intermediate "useful" type classes between Applicative Functors & Monads?

2011-06-05 Thread Ben Lippmeier
re hard. Not as hard as formalising "useful". Ben. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Is fusion overrated?

2011-05-17 Thread Ben Lippmeier
ALU instructions on a modern machine. Ben. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] repa Shape help

2011-05-09 Thread Ben Lippmeier
y that didn't work. Try (Z :. 2 :. 3). This is basically a list containing the column and row lengths. Similar to (3 : 2 : []), except that the list extends to the left instead of the right. The Z constructor is equivalent to []. Cheers, Ben. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Python is lazier than Haskell

2011-04-29 Thread Ben Lippmeier
On 29/04/2011, at 6:08 PM, Malcolm Wallace wrote: > On 29 Apr 2011, at 05:38, Ben Lippmeier wrote: > >> Laziness at the value level causes space leaks, > > This is well-worn folklore, but a bit misleading. :-) Like permanent markers in the hands of children causes suff

Re: [Haskell-cafe] Python is lazier than Haskell

2011-04-28 Thread Ben Lippmeier
leaks. Neither are much fun. When people start wanting laziness at the kind level we'll have to quarantine them before the virus spreads... Ben. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] CFT -- Haskell Implementors' Workshop 2011

2011-04-19 Thread Ben Lippmeier
(Portland State University) * Ben Lippmeier - co-chair (University of New South Wales) * Andres Loeh (Well-Typed LLP) * Oleg Lobachev(University of Marburg) * Neil Mitchell - co-chair (Standard Chartered) * Dimitrios

[Haskell-cafe] timsort

2011-04-15 Thread Ben
hello -- has anyone every implemented (and benchmarked) timsort in haskell? http://bugs.python.org/file4451/timsort.txt it is a stable mergesort-like algorithm, seems like a good fit for haskell. best, ben ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Using DPH

2011-04-12 Thread Ben Lippmeier
ations are > performed inside the R.sum. Yeah, the Repa fold and sum functions just use the equivalent Data.Vector ones. They're not parallelised and I haven't looked at the generated code. I'll add a ticket to the trac to fix these, but won't h

Re: [Haskell-cafe] Using DPH

2011-04-12 Thread Ben Lippmeier
0.22 sys This runs but doesn't scale with an increasing number of threads. I haven't looked at why. If all the work is in R.sum then that might be the problem -- I haven't put much time into optimising reductions, just maps and filters. Cheers, Ben. [1] http:

Re: [Haskell-cafe] Learn You a Haskell for Great Good - a few doubts

2011-03-10 Thread Ben Moseley
referential transparency, > evaluation induces an equivalence relation. This implies that (_|_, _|_) = > _|_ = (_|_, _|_). Surely the key thing is the '(' character which is produced immediately before the exception is encountered. I'd say that demon

Re: [Haskell-cafe] [Haskell] ANNOUNCE: haskell-src-meta 0.3

2011-01-04 Thread Ben Millwood
It seems I wasn't subscribed to haskell-cafe so this reply didn't get through (sorry for sending this twice, Felipe). I've now subscribed with delivery turned off for -cafe so if you want me to read a response be sure to address me directly :) On Tue, Jan 4, 2011 at 5:08 AM, Ben

Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-11 Thread Ben Lippmeier
esis/lippmeier-impure-world.pdf Disciple doesn't have type functions or associated types though. I think it'd be "nicer" for GHC if we could leverage some of the other extensions, as suggested in Mark Lentczner's post. Ben. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Stack Overflow?

2010-11-11 Thread Ben Christy
It was basically that. I was doing TransformedMatrix = TransformedMatrix * TransformMatrrix and should have been doing Transformed Matrix = RotatedMatrix * TransforrmMatrix On Thu, Nov 11, 2010 at 10:03 AM, Dmitry Astapov wrote: > On Thu, Nov 11, 2010 at 4:58 PM, Ben Christy > wrote:

[Haskell-cafe] Stack Overflow?

2010-11-11 Thread Ben Christy
I have implemented a scene graph in Haskell and I have a problem. I walk down the scenegraph and at each node I recalculate translation matrix and pass it to each child. Well it seems to be causing a stack overflow and I am lost as to how to resolve the issue without issue a state variable of some

Re: [Haskell-cafe] What do you call Applicative Functor Morphism?

2010-11-06 Thread Ben
category theory encompasses more than just algebra. so there are homomorphisms, but also diffeomorphisms, symplectomorphisms, et cetera (in addition to things which don't have the -morphism suffix in normal usage, like continuous maps, natural transformations.) b On Nov 6, 2010, at 7:19 A

Re: [Haskell-cafe] Package regex-posix-0.94.2 suddenly failed to link

2010-10-30 Thread Ben Millwood
On Sat, Oct 30, 2010 at 11:56 AM, Arnaud Bailly wrote: > Hello, > All of a sudden, the package regex-posix-0.94.2 failed to link after i > installed a couple of other packages (http, json). When I try to > reinstall it, I got the folowing errors: > > D:\projets\crete1941>cabal install --global --r

Re: [Haskell-cafe] Re: Monads and Functions sequence and sequence_

2010-10-30 Thread Ben Millwood
The actual, entire, complete definitions of sequence and sequence_ are (or at least, could be): > sequence [] = return [] > sequence (m:ms) = do > x <- m > xs <- sequence ms > return (x:xs) > > -- or, equivalently: > sequence' = foldr (liftM2 (:)) (return []) > > sequence_ [] = return () > s

Re: [Haskell-cafe] type class design

2010-10-29 Thread Ben Millwood
On Fri, Oct 29, 2010 at 1:33 PM, Tillmann Rendel wrote: > > Note that the case of (==) and (/=) is slightly different, because not only > can (/=) be defined in terms (==), but also the other way around. The > default definitions of (==) and (/=) are mutually recursive, and trivially > nonterminat

Re: [Haskell-cafe] who's in charge?

2010-10-29 Thread Ben Millwood
On Fri, Oct 29, 2010 at 5:06 AM, Steve Severance wrote: > whenever I here any open source community > (yeah...everyone not just haskell) tell beginners to contribute a > package I always scratch my head with a little bit of wonder. Would > you really want a package that someone like me who is stil

Re: [Haskell-cafe] Re: Current thinking on CompositionAsDot issue in haskell prime?

2010-10-28 Thread Ben Millwood
On Thu, Oct 28, 2010 at 11:12 AM, John Smith wrote: > On 28/10/2010 10:15, Alexander Kjeldaas wrote: >> >> Hi haskellers. >> >> Reading through the Haskell Prime suggestions, one that caught my eye is >> the CompositionAsDot issue. >> >> I'm especially thinking of the Pro issue: >> * Paves the way

Re: [Haskell-cafe] Test command line programs

2010-10-26 Thread Ben Millwood
On Tue, Oct 26, 2010 at 5:11 PM, Dupont Corentin wrote: > Hello again café, > > I have a command line program that takes input from various handles > (actually network sockets) like this: > >> s <- hGetLine h >> etc. > > I'd like to unit test this. How can I do? If all you ever do in some part of

[Haskell-cafe] Re: A rant against the blurb on the Haskell front page

2010-10-22 Thread Ben Franksen
e when judging a programming >> language?", I found that I most like a gallery of small example programs. > > I started such a gallery in the style of a restaurant menu some years > ago, but never got around to finishing it: >

Re: [Haskell-cafe] Haskellers.com skills list moderation?

2010-10-20 Thread Ben Millwood
On Tue, Oct 19, 2010 at 2:32 PM, Michael Snoyman wrote: > Algorithmic Problem Solving I think this needs to go, because I'm really having a hard time imagining any programmer who doesn't do this. > High Assurance Software Development This sounds vague to me and/or the same as other skills (cf.

[Haskell-cafe] Re: Proving stuff about IORefs

2010-10-17 Thread Ben Franksen
Hi Mathew Matthew Brecknell wrote: > Ben Franksen wrote: >> Suppose we have a function >> >> f :: IORef a -> IO b >> >> I want to prove that >> >> f r == do >> s1 <- readIORef r >> r' <- newIORef s1 >>

[Haskell-cafe] Re: Re: Proving stuff about IORefs

2010-10-17 Thread Ben Franksen
Ben Millwood wrote: > On Sun, Oct 17, 2010 at 11:15 AM, Malcolm Wallace > wrote: >> >> The problem with the code you originally posted was that it looked like >> this: >> >> f r = do r' <- something >> f r' >> something else -- this i

[Haskell-cafe] Re: Proving stuff about IORefs

2010-10-17 Thread Ben Franksen
Derek Elkins wrote: > On Sun, Oct 17, 2010 at 6:49 AM, Miguel Mitrofanov > wrote: >> >> On 17 Oct 2010, at 05:21, Ben Franksen wrote: >> >>> I want to prove that >>> >>> f r == do >>> s1 <- readIORef r >>> r' <- n

Re: [Haskell-cafe] Re: Proving stuff about IORefs

2010-10-17 Thread Ben Millwood
On Sun, Oct 17, 2010 at 11:15 AM, Malcolm Wallace wrote: > > The problem with the code you originally posted was that it looked like > this: > >  f r = do r' <- something >           f r' >           something else -- this is dead code > > That is, the computation is non-terminating, because f sim

[Haskell-cafe] Re: Proving stuff about IORefs

2010-10-16 Thread Ben Franksen
Derek Elkins wrote: > On Sat, Oct 16, 2010 at 9:21 PM, Ben Franksen > wrote: >> I have a formal proof where I am stuck at a certain point. >> >> Suppose we have a function >> >> f :: IORef a -> IO b >> >> I want to prove that >> >>

[Haskell-cafe] Re: Re: A rant against the blurb on the Haskell front page

2010-10-16 Thread Ben Franksen
wren ng thornton wrote: > On 10/16/10 11:22 AM, Ben Franksen wrote: >> Much better. Though I *do* think mentioning the main implementations and >> their qualities is a good thing to o, right after this: >> >> "[...]The most >> important Haskell implementation,

[Haskell-cafe] Re: Re: A rant against the blurb on the Haskell front page

2010-10-16 Thread Ben Franksen
wren ng thornton wrote: > On 10/16/10 10:48 AM, Ben Franksen wrote: >> Don Stewart wrote: >>> It is open source, and was born open source. It is the product of >>> research. >> >> How can a language be open source, or rather, how can it *not* be open

[Haskell-cafe] Proving stuff about IORefs

2010-10-16 Thread Ben Franksen
What happens here is that the temporary IORef r' takes the place of the argument r, and after we apply f to it we take its content and store it in the original r. This should be the same as using r as argument to f in the first place. How can I prove this formally? Cheers Ben

Re: [Haskell-cafe] An interesting paper from Google

2010-10-16 Thread Ben Millwood
On Fri, Oct 15, 2010 at 9:28 PM, Andrew Coppin wrote: > I'm still quite > surprised that there's no tool anywhere which will trivially print out the > reduction sequence for executing an expression. You'd think this would be > laughably easy, and yet nobody has done it yet. > I tried to do someth

[Haskell-cafe] Re: A rant against the blurb on the Haskell front page

2010-10-16 Thread Ben Franksen
Ben Franksen wrote: >> > That cutting edge research is done for Haskell as well as for its >> > implementations is of course good to know, but just stating it is >> > not nearly enough: such a statement must be corroberated with >> > evidence,

[Haskell-cafe] Re: A rant against the blurb on the Haskell front page

2010-10-16 Thread Ben Franksen
Christopher Done wrote: > On 16 October 2010 05:52, Ben Franksen wrote: >> what marketing idiot has written this inclonclusive mumble-jumble of >> buzz-words? >> [...] >> How can anyone write such a >> nonsense? Haskell is not an "open source product"!

[Haskell-cafe] Re: A rant against the blurb on the Haskell front page

2010-10-16 Thread Ben Franksen
Donn Cave wrote: > Quoth Ben Franksen , >> Enough. I think I have made my point. > > Yes, though possibly a little overstated it. While it's easy to share > your distaste for the blurb, if you take a generous attitude towards it, > most of it is "true enough.&q

[Haskell-cafe] Re: A rant against the blurb on the Haskell front page

2010-10-16 Thread Ben Franksen
with high quality? What has the supposed availability of > > debuggers (where? which?) to do with it? > > These are precisely the reason that e.g. Galois uses Haskell. > Maintainable, concise, correct software. I am not disputing this. > > Enough. I think I have

[Haskell-cafe] A rant against the blurb on the Haskell front page

2010-10-15 Thread Ben Franksen
ows from the previous points, which is what the sentence is saying. What has an FFI do to with high quality? What has the supposed availability of debuggers (where? which?) to do with it? Enough. I think I have made my point. Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Re: Re: Make your Darcs repositories hashed?

2010-10-13 Thread Ben Franksen
Jason Dagit wrote: > On Tue, Oct 12, 2010 at 4:41 PM, Ben Franksen > wrote: >> Seriously, the server is a debian etch (!) system. Also called "debian >> old-stable". Of course I have long since installed newer version of >> darcs, but since I am not root there I

[Haskell-cafe] Re: Re: Make your Darcs repositories hashed?

2010-10-12 Thread Ben Franksen
Jason Dagit wrote: > On Tue, Oct 12, 2010 at 2:02 PM, Ben Franksen > wrote: > >> One minor but important note: the hashed format is *not* readable with a >> darcs-1 program: > > Sorry about that. The support for hashed repos existed long before 2.0 > was relea

[Haskell-cafe] Re: Haskellers.com recent changes (and I need some volunteers)

2010-10-12 Thread Ben Franksen
, I don't think it is difficult to >> imagine situations where one doesn't wish to show a picture of his/her >> face. > > Agree. But then there should be no picture at all for a given person. > As Michael said -- no cartoons, no identicons. Why not? They can say more about a person than a picture (not some generic, auto-chosen one, of course). Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Re: A question regarding cmdargs package

2010-10-12 Thread Ben Franksen
haring your program. Not sure if you should share > "launchMissiles" at all.) launchMissiles = putStrLn "Boom! (just kidding :)" BTW another cool feature of an auto-magic option parsing lib is the GNU standard "--" (arguments after this are not to be treated as options). Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Re: A question regarding cmdargs package

2010-10-12 Thread Ben Franksen
d -? does not work in all shells/configurations and --help might look strange if all other options are of the one-dash-one-character sort. I would also like to configure the help text for the standard options, for instance for i18n or because I like starting with a lower case letter or..

[Haskell-cafe] Re: Make your Darcs repositories hashed?

2010-10-12 Thread Ben Franksen
One minor but important note: the hashed format is *not* readable with a darcs-1 program: (after a darcs optimize --upgrade in /opt/repositories/controls/darcs/apps/HoBiCaT) frank...@aragon:~/tmp > /usr/bin/darcs --version 1.0.9rc1 (release candidate 1) frank...@aragon:~/tmp > /usr/bin/darcs get

[Haskell-cafe] Re: My knight's tour does not seem to end

2010-10-10 Thread Ben Franksen
rator code; though I feel like I am on the verge of finally getting the hang of it). Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Layered maps

2010-10-08 Thread Ben Franksen
ound such a type. Alex, could you give an example for what would be 'a convenient syntax' for such a type? What operations do you think should be available to make using it convenient? Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Re: Bulletproof resource management

2010-10-08 Thread Ben Franksen
Florian Weimer wrote: > * Ben Franksen: >> You might be interested in Lightweight Monadic Regions >> >> http://okmij.org/ftp/Haskell/regions.html#light-weight >> >> which solve the problem (IMHO) in a much cleaner way, i.e. w/o explicit >> closing and

[Haskell-cafe] Re: Bulletproof resource management

2010-10-08 Thread Ben Franksen
ection (or is GHC sufficiently smart to optimize it away)? You might be interested in Lightweight Monadic Regions http://okmij.org/ftp/Haskell/regions.html#light-weight which solve the problem (IMHO) in a much cleaner way, i.e. w/o explicit closing and also w/o using finalizers. Cheers Ben _

Re: [Haskell-cafe] Pronouncing "Curry" and "currying"

2010-10-08 Thread Ben Millwood
On Fri, Oct 8, 2010 at 8:56 AM, Petr Pudlak wrote: > thanks for both the explanation (Donn) and the sound sample (Luke). > Unfortunately, "hurry" is pronounced differently in British and US English > [1], so again I was a little bit confused :-). But Luke's sound sample made > it clear for me. >

Re: [Haskell-cafe] Eta-expansion destroys memoization?

2010-10-07 Thread Ben Millwood
On Thu, Oct 7, 2010 at 1:44 PM, Luke Palmer wrote: > The section works because "(a %^&)"  (for some operator %^&) is short > for "(%^&) a" and "(%^& a)" is short for "flip (%^&) a".  Sections > don't expand into lambdas. > According to the report they do: http://haskell.org/onlinereport/exps.html

[Haskell-cafe] Re: A question regarding cmdargs package

2010-10-04 Thread Ben Franksen
Arie Peterson wrote: > On Sun, 03 Oct 2010 19:18:08 +0200, Ben Franksen > wrote: >> How can I disable the standard arguments 'help' and 'version'? > > If you're not fully committed to the cmdargs package, you might try my > package 'console-pro

[Haskell-cafe] Re: Haskell Helper

2010-10-03 Thread Ben Franksen
Ben Franksen wrote: > The type checker tells you that you are using the same Map with different > key types: at 52:17-19 the key has type [Hai], whereas at 47:16-18 it has > type Hai. > > The latter is in your Func case: s/latter/former/

[Haskell-cafe] Re: Re: A parsec question

2010-10-03 Thread Ben Franksen
Antoine Latter wrote: > On Sun, Oct 3, 2010 at 11:55 AM, Ben Franksen > wrote: >> Stephen Tetley wrote: >>> Does this one give the "expected" error message for Parsec3.1 - >>> unfortunately I can't test as I'm still using Parsec 2.

[Haskell-cafe] Re: Haskell Helper

2010-10-03 Thread Ben Franksen
hat a definition function-name,arg1,...,argn=body actually defines a variable named "function-name" which, when it gets looked up in the environment, yields the value Func [arg1,...,argn] body . Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Haskell Helper

2010-10-03 Thread Ben Franksen
e arguments? I ask because I am not sure whether it represents function definition or function call. Maybe yuou can give a small example for a function definition as well as a function application (call) in your Hai language. Cheers Ben ___ Haskell-Caf

[Haskell-cafe] A question regarding cmdargs package

2010-10-03 Thread Ben Franksen
How can I disable the standard arguments 'help' and 'version'? Cheers ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Re: Non-existing types in existential quantification?

2010-10-03 Thread Ben Franksen
Henning Thielemann wrote: > On Sun, 3 Oct 2010, Ben Franksen wrote: >> Christopher Done wrote: >> >>> Consider the following program: >>> >>> main = putStrLn $ show $ length [undefined :: a,undefined :: b] >>> >>> A concrete type of the

[Haskell-cafe] Re: A parsec question

2010-10-03 Thread Ben Franksen
Stephen Tetley wrote: > Does this one give the "expected" error message for Parsec3.1 - > unfortunately I can't test as I'm still using Parsec 2.1.0.1. > >> parser = block (many digit "digit") Unfortunately, no. Cheers Ben ___

[Haskell-cafe] Re: Non-existing types in existential quantification?

2010-10-02 Thread Ben Franksen
ermined > at runtime, or any time. a unifies with b, and that unifies with x in > length :: [x] -> Int. A simpler example is main = print Nothing Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: A parsec question

2010-09-30 Thread Ben Franksen
Christian Maeder wrote: > Am 29.09.2010 20:01, schrieb Daniel Fischer: >> On Wednesday 29 September 2010 19:10:22, Ben Franksen wrote: >>>> >>>> Note the last line mentions only '}'. I would rather like to see >>>> >>>> expec

[Haskell-cafe] Re: I still cannot seem to get a GUI working under Windows.

2010-09-29 Thread Ben Franksen
e screwed. *This* is when things become *really* difficult. All this compiling and installing libraries stuff is harmless, compared to the problems caused by stupidly broken APIs and crippled languages. Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Re: A parsec question

2010-09-29 Thread Ben Franksen
Daniel Fischer wrote: > On Wednesday 29 September 2010 19:10:22, Ben Franksen wrote: >> > >> > Note the last line mentions only '}'. I would rather like to see >> > >> > expecting "}" or digit >> > >> > since the par

[Haskell-cafe] Re: A parsec question

2010-09-29 Thread Ben Franksen
Ben Franksen wrote: >> import Control.Applicative ((*>),(<*)) >> import Text.Parsec >> import Text.Parsec.Char >> block p = char '{' *> p <* char '}' >> parser = block (many digit) >> main = parseTest parser "{123a}" >

[Haskell-cafe] A parsec question

2010-09-29 Thread Ben Franksen
t is the reason for this behaviour? (2) Is there another combinator that behaves as I would like? (3) Otherwise, how do I write one myself? BTW, I am using parsec-3.1.0 and ghc-6.12.3. Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Coding conventions for Haskell?

2010-09-28 Thread Ben Millwood
On Tue, Sep 28, 2010 at 5:55 AM, Evan Laforge wrote: > > I write haskell and python in a proportional font and it hasn't yet > let to tabs, so no pain so far :) > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman

[Haskell-cafe] Re: Non-strict evaluation and concurrency (STM) : conflict?

2010-09-28 Thread Ben Franksen
one much easier with the `par` combinator and friends (http://hackage.haskell.org/package/parallel). The same caveat wrt lazyness applies to this method, but your code will become a lot simpler: no need to explicitly manage threads, pure functional (non-mo

Re: [Haskell-cafe] Applicative instances for Monads

2010-09-25 Thread Ben Millwood
On Sat, Sep 25, 2010 at 3:01 AM, Gregory Crosswhite wrote: > == > > import Control.Applicative > import Control.Concurrent > import Control.Concurrent.MVar > > newtype AIO a = AIO {unAIO :: IO a} > > instance Monad AIO where >   r

[Haskell-cafe] Re: Re: Re: Re: Do expression definition

2010-09-20 Thread Ben Franksen
wren ng thornton wrote: > On 9/17/10 4:04 PM, Ben Franksen wrote: >> wren ng thornton wrote: >>> Note that when compilers do CPS conversion, everything is >>> converted into let-binding and continuations (i.e., longjump/goto with >>> value passing). It's ju

Re: [Haskell-cafe] Problems with installing type-level package

2010-09-19 Thread Ben Millwood
2010/9/19 Николай Кудасов : > Hi, cafe, > I have a stange thing when trying to install type-level package: > > $ sudo ./Setup.hs configure > Configuring type-level-0.2.4... > $ sudo ./Setup.hs build > Preprocessing library type-level-0.2.4... > Building type-level-0.2.4... > [1 of 8] Compiling Data

[Haskell-cafe] Re: Re: Re: Full strict functor by abusing Haskell exceptions

2010-09-17 Thread Ben Franksen
Román González wrote: > On Thu, Sep 16, 2010 at 2:12 PM, Ben Franksen > wrote: > >> Sjoerd Visscher wrote: >> > But StrictIncl can't be a pointed functor, only endofunctors can be >> > pointed. >> >> Could someone tell me what exactly a p

[Haskell-cafe] Re: Re: Re: Do expression definition

2010-09-17 Thread Ben Franksen
wren ng thornton wrote: > On 9/16/10 4:59 PM, Ben Franksen wrote: >> even though we always have >> >>(\x -> e) y == let x = y in e >> >> which means that let can be translated to lambda, the converse is not >> true, > > Not exactly. Note that

Re: [Haskell-cafe] Idea for hackage feature

2010-09-16 Thread Ben Millwood
On Fri, Sep 17, 2010 at 1:44 AM, Ivan Lazar Miljenovic wrote: > On 17 September 2010 03:18, Henning Thielemann >> My suggestion is to move the Unsafe modules to a new package 'unsafe'. >> Then you can easily spot all "dirty" packages by looking at reverse >> dependencies of 'unsafe'. > > Hooray, y

Re: [Haskell-cafe] Curious why "cabal upgrade parsec" not installing latest version

2010-09-16 Thread Ben Millwood
On Thu, Sep 16, 2010 at 4:00 AM, Ivan Lazar Miljenovic wrote: > Because Parsec-3 apparently still has some speed regressions compared > to Parsec-2 (I'm not qualified to note whether its design is slow or > if you have to use it differently to get good performance out of it), > so many developers

Re: [Haskell-cafe] IO Put confusion

2010-09-16 Thread Ben Millwood
On Wed, Sep 15, 2010 at 12:45 AM, Chad Scherrer wrote: > 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

[Haskell-cafe] Re: Re: Full strict functor by abusing Haskell exceptions

2010-09-16 Thread Ben Franksen
Sjoerd Visscher wrote: > But StrictIncl can't be a pointed functor, only endofunctors can be > pointed. Could someone tell me what exactly a pointed functor is? I googled but did not find a definition. Thanks Ben ___ Haskell-Cafe mailing l

[Haskell-cafe] Re: Re: Do expression definition

2010-09-16 Thread Ben Franksen
ould* be extended to infer polymorphic types for those lambda-bound variables where the lambda expression immediately gets applied to some other expression. In practice this would be of little use as these are exactly the situations where a let can (and should!) be used instead of a lambda. Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread Ben Millwood
On Wed, Sep 15, 2010 at 2:11 PM, Kevin Jardine wrote: > > I do think that > > defObj(MyType) > > looks a bit cleaner than > > $(defObj "MyType") > I believe as of GHC 6.12 you no longer need the $() around top-level splices. So that would just be: defObj "MyType"

Re: [Haskell-cafe] Re: Cleaning up threads

2010-09-14 Thread Ben Millwood
On Tue, Sep 14, 2010 at 9:44 PM, Mitar wrote: > Hi! > > On Tue, Sep 14, 2010 at 9:04 PM, Gregory Collins > wrote: >> That's surprising to me -- this is how we kill the Snap webserver >> (killThread the controlling thread...). > > Yes. This does work. The only problem is that my main thread then >

Re: [Haskell-cafe] Do expression definition

2010-09-13 Thread Ben Millwood
On Mon, Sep 13, 2010 at 8:21 AM, Alexander Kotelnikov wrote: > And, also, would it make any difference if > > > do {p <- e; stmts}      =       let ok p = do {stmts} >    ok _ = fail "..." >  in e >>= ok > > is redefined as "e >>= (\p -> do {stmts})"? This is the magic that allows pattern-match f

Re: [Haskell-cafe] Disable LINE Pragma handling in GHC

2010-09-10 Thread Ben Millwood
On Fri, Sep 10, 2010 at 7:40 AM, JP Moresmau wrote: > I suppose even using GHC for building and something else > (haskell-src-exts?) for code handling would leave us with compilation > messages at the wrong place. I don't quite understand your use case so I'm not sure it helps, but for what it's

Re: [Haskell-cafe] How to catch exception within the Get monad (the Binary package)

2010-09-07 Thread Ben Millwood
On Tue, Sep 7, 2010 at 2:45 PM, Dimitry Golubovsky wrote: > unThrow a = unsafePerformIO $ (E.evaluate a >>= return . Right) `E.catch` >                                               (\e -> return $ Left e) > > -- or perhaps the right argument of catch could be just (return . Left)? > > bm2mb :: a

<    1   2   3   4   5   6   7   8   >