Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-11-30 Thread Ben Franksen
, there is no return for that in the Map case for exactly the same reason as with Apply: the unit would have have value id for every possible key, so cannot be finite. So what about an example for Bind\\Monad that is not yet another variation of the finite structure theme? Cheers -- Ben Franksen

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-11-29 Thread Ben Franksen
Brent Yorgey wrote: On Thu, Nov 29, 2012 at 03:52:58AM +0100, Ben Franksen wrote: Tony Morris wrote: As a side note, I think a direct superclass of Functor for Monad is not a good idea, just sayin' class Functor f where fmap :: (a - b) - f a - f b class Functor f = Apply f

[Haskell-cafe] A big hurray for lambda-case (and all the other good stuff)

2012-11-28 Thread Ben Franksen
. GHC is just simply amazing. You guys RULE THE WORLD! Cheers -- Ben Franksen () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-11-28 Thread Ben Franksen
should hold for them. Cheers -- Ben Franksen () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

Re: [Haskell-cafe] Why Kleisli composition is not in the Monad signature?

2012-11-28 Thread Ben Franksen
implementations for = in terms of = and vice versa, so that you can still use = as the primitive operation when implementing an instance. Cheers -- Ben Franksen () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments

[Haskell-cafe] Serializing with alignment

2012-11-06 Thread Ben Franksen
. Cheers -- Ben Franksen () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Correspondence between libraries and modules

2012-05-07 Thread Ben Franksen
Alvaro Gutierrez wrote: I've only dabbled in Haskell, so please excuse my ignorance: why isn't there a 1-to-1 mapping between libraries and modules? As I understand it, a library can provide any number of unrelated modules, and conversely, a single module could be provided by more than one

Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.1.0

2012-04-17 Thread Ben Franksen
Paolo Capriotti wrote: On Mon, Apr 16, 2012 at 10:13 PM, Ben Franksen ben.frank...@online.de wrote: (1) What is the reason for the asymmetry in type Producer b m = Pipe () b m type Consumer a m = Pipe a Void m i.e. why does Producer use () for the input? I would expect it to use Void

Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.1.0

2012-04-16 Thread Ben Franksen
Paolo Capriotti wrote: I'm pleased to announce the release of version 0.1.0 of pipes-core, a library for efficient, safe and compositional IO, similar in scope to iteratee and conduits. http://hackage.haskell.org/package/pipes-core I like your pipes package. This is very similar to what

Re: [Haskell-cafe] Deduce problem.

2011-11-21 Thread Ben Franksen
Magicloud Magiclouds wrote: So I think I got what you guys meant, I limited ClassB to only H. Then how to archive my requirement, that from and to only return items that instanced ClassB? If you are willing to go beyond Haskell98 (or Haskell2010), you can use a multi-parameter class. Enable

Re: [Haskell-cafe] Interpreter with Cont

2011-11-21 Thread Ben Franksen
You'll probably get answers from people who are more proficient with this, but here's what I learned over the years. Tim Baumgartner wrote: Is Cont free as well? No. In fact, free monads are quite a special case, many monads are not free, e.g. the list monad. I believe what David Menendez

Re: [Haskell-cafe] A Mascot

2011-11-21 Thread Ben Franksen
heathmatlock wrote: Cute! I like it! Yea, it's cute. I don't like the formula, though: \x - x + x is just too trivial and not very Haskellish. Something higher order is the minimum requirement, IMO. The original (lambda knights) formula was cool: the fixed point operator is directly related

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

2011-10-30 Thread Ben Franksen
Benjamin Franksen wrote: David Barbour wrote: Create an extra TVar Int for every `chunk` in the array (e.g every 256 elements, tuned to your update patterns). Read-write it (increment it, be sure to force evaluation) just before every time you write an element or slice it or slice the array

[Haskell-cafe] Efficient mutable arrays in STM

2011-10-25 Thread Ben Franksen
I have an application in mind where concurrent access to large arrays (up to millions of elements) of mostly small elements (Int or Double) is common. Typical access patterns would be chunk-wise, i.e. reads or writes from index n up to index m. Imagine stuff like images, scientific data, etc.

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 ben.frank...@online.dewrote: 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 have to implement this manually

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

2011-10-25 Thread Ben Franksen
Ketil Malde wrote: Ben Franksen ben.frank...@online.de 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, not science

[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 miguelim...@yandex.ru wrote: On 17 Oct 2010, at 05:21, Ben Franksen wrote: I want to prove that f r == do s1 - readIORef r r' - newIORef s1 x - f r' s3 - readIORef r' writeIORef r s3 return x That is not true

[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 malcolm.wall...@me.com 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,

[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 x - f r' s3 - readIORef r' writeIORef r s3 return x I'm not sure where in your

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

2010-10-16 Thread Ben Franksen
Don Stewart wrote: ben.franksen: Haskell is an advanced purely functional programming language. Good start, if only the advanced were replaced with something more characteristic, like lazy, or statically typed. Which, BTW, both do not lazy and statically

[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 ben.frank...@online.de, 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. Sorry. I

[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 ben.frank...@online.de 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! [...] I am ashamed

[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, otherwise it is just idle marketing

[Haskell-cafe] Proving stuff about IORefs

2010-10-16 Thread Ben Franksen
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 f r == do s1 - readIORef r r' - newIORef s1 x - f r' s3 - readIORef r' writeIORef r s3 return x What happens here is that the temporary

[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 source? The point of a (programming) language

[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, ghc [like to ghc page], has served as a test bed

[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 ben.frank...@online.de 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 f r == do s1 - readIORef r r' - newIORef s1 x - f r' s3

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

2010-10-15 Thread Ben Franksen
This is a critique of the current 'Haskell Blurb', the first paragraph on www.haskell.org. This blurb should, IMO, give a concise description of what Haskell, the programming language, is, what makes it different from other languages, and why I should be interested in it. What it does, instead,

[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 ben.frank...@online.dewrote: 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 cannot put it into /usr

[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: Re: A question regarding cmdargs package

2010-10-12 Thread Ben Franksen
Neil Mitchell wrote: This makes me curious.  What's the use case where you want to allow the user to pass arguments on the command line, but you don't want that user to be able to use '--help' to find out what arguments may be passed? I wanted to create a clone of an existing program that had

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

2010-10-12 Thread Ben Franksen
Joachim Breitner wrote: Am Dienstag, den 12.10.2010, 16:42 +1100 schrieb Ivan Lazar Miljenovic: On 12 October 2010 16:32, Magnus Therning mag...@therning.org wrote: This makes me curious. What's the use case where you want to allow the user to pass arguments on the command line, but you

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

2010-10-12 Thread Ben Franksen
Roman Cheplyaka wrote: On Mon, 11 Oct 2010 13:09:00 +0200, Vo Minh Thu not...@gmail.com wrote: 2010/10/11 Roman Cheplyaka r...@ro-che.info: On Mon, 11 Oct 2010 11:54:12 +0100, Magnus Therning mag...@therning.org wrote: On Mon, Oct 11, 2010 at 08:37, Michael Snoyman mich...@snoyman.com

[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 ben.frank...@online.dewrote: 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 released and so I

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

2010-10-10 Thread Ben Franksen
Stephen Tetley wrote: On 10 October 2010 11:31, C K Kashyap ckkash...@gmail.com wrote: Did you mean this http://www.cs.tufts.edu/~nr/comp150fp/archive/richard-bird/sudoku.pdf? I was actually meaning these slides... http://icfp06.cs.uchicago.edu/bird-talk.pdf But the paper is definitely

[Haskell-cafe] Re: Bulletproof resource management

2010-10-08 Thread Ben Franksen
Florian Weimer wrote: At least in my experience, in order to get proper resource management for things like file or database handles, you need both a close operation and a finalizer registered with the garbage collector. The former is needed so that you can create resources faster than the

[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 also w/o using finalizers. Is this approach

[Haskell-cafe] Re: Layered maps

2010-10-08 Thread Ben Franksen
Thomas DuBuisson wrote: On Fri, Oct 8, 2010 at 2:23 PM, Alex Rozenshteyn rpglove...@gmail.com wrote: Does there exist a library which allows me to have maps whose elements are maps whose elements ... with a convenient syntax. The containers library can do this already - there are no

[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 ben.frank...@online.de 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-program' instead http

[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 mailing list

[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 element in list doesn't need to be determined at runtime, or any time. a unifies

[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: Haskell Helper

2010-10-03 Thread Ben Franksen
c8h10n4o2 wrote: No, it is not secret. I'm having trouble to define functions. Take a look at my code(please be gentle) http://haskell.1045720.n5.nabble.com/file/n3100036/hai1.hs hai1.hs Can you explain in a few words what the Func constructor should represent why it has three arguments? I ask

[Haskell-cafe] Re: Haskell Helper

2010-10-03 Thread Ben Franksen
c8h10n4o2 wrote: The problem is there. A function in Hai would be function-name, arg1,argn=body. Func stores function name,arguments and body as Strings(I was thinking to put Func String String String). The parser func that I wrote so far try to parse a function definition, not a function

[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 ben.frank...@online.de 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.1.0.1. parser = block (many digit ? digit

[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

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

2010-10-02 Thread Ben Franksen
Christopher Done wrote: On 1 October 2010 15:27, Henning Thielemann lemm...@henning-thielemann.de wrote: Given the following code, that is accepted by GHC: data Exist = forall a. Exist a exist :: Exist exist = Exist undefined What type has the 'undefined' ? I think its type is `a'.

[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 expecting } or digit since the parser could very well accept another digit here. parsec2

[Haskell-cafe] A parsec question

2010-09-29 Thread Ben Franksen
I have a question about Parsec. The following program import Control.Applicative ((*),(*)) import Text.Parsec import Text.Parsec.Char block p = char '{' * p * char '}' parser = block (many digit) main = parseTest parser {123a} gives the output parse error at (line 1, column 5):

[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} gives the output parse error at (line 1, column 5): unexpected a expecting } Note

[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 parser could very well accept another digit here. parsec2 did that, I don't know whether that change

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

2010-09-29 Thread Ben Franksen
Andrew Coppin wrote: On 29/09/2010 07:33 PM, Steve Schafer wrote: The issue isn't that there aren't a lot of Windows developers who have an interest in Haskell+GUI development. The issue is that nearly every Windows developer who looks into Haskell+GUI says, This stuff sucks, and walks

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

2010-09-28 Thread Ben Franksen
Romain Demeyer wrote: Imagine this scenario : we have a set of threads (the workers) that have (each) a result to compute (purely). When finished, they try to save the result in an shared inbox, using STM. If the inbox is full, the thread waits until the inbox is empty. A specific thread is

[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 just dual to the everything-is-lambda world, nothing

[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 when compilers do CPS conversion, everything is converted

[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 ben.frank...@online.dewrote: 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

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

2010-09-16 Thread Ben Franksen
wren ng thornton wrote: On 9/13/10 6:22 AM, Michael Lazarev wrote: Thanks for examples and pointers. Since I came from Lisp, it never occurred to me that let and lambda are different constructs in Haskell. I thought that let x = y in f is really (\x - f) y It turns out that

[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 list

[Haskell-cafe] Haskell for control system [was: [reactive] A pong and integrate]

2010-05-19 Thread Ben Franksen
David Leimbach wrote: I find it's often the most practical chapter that I hit a lot during writes and changes to my server process I have in Haskell in our control system code :-) Are you actually saying that you use Haskell for a control system server? Thta would be very interesting to me.

[Haskell-cafe] Re: What do _you_ want to see in FGL?

2010-05-17 Thread Ben Franksen
Neil Brown wrote: Primarily I want to see in FGL: documentation, documentation and more documentation. +1 Cheers Ben ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: darcs 2.4 release candidate 2

2010-02-21 Thread Ben Franksen
And here are the numbers for record -lam: b...@sarun[1]: .../rtems/rtems-4.9.0 darcs --version 2.3.1 (release) b...@sarun[1]: .../rtems/rtems-4.9.0 time darcs record -lam'import release 4.9.0' Finished recording patch 'import release 4.9.0' darcs record -lam'import release 4.9.0' 143,33s user

[Haskell-cafe] Re: darcs 2.4 release candidate 2

2010-02-21 Thread Ben Franksen
Ben Franksen wrote: The situation with record is similar. I admit that the huge RTEMS tree with over 7000 changes between the two releases is challenging. However, earlier releases can do it (though it takes long, much longer than with, say, mercurial). Just for comparison, here

[Haskell-cafe] Re: Re[2]: Threading and FFI

2010-02-21 Thread Ben Franksen
Yves Parès wrote: Just one last remark: when I moved all my OpenGL calls from the main thread to an unbound thread. I thought it'd not work -- because I assumed I would have to launch it in a bound thread -- and however it went right... You were just lucky the RTS accidentally delegated all

[Haskell-cafe] Re: darcs 2.4 release candidate 2

2010-02-19 Thread Ben Franksen
Hi All This rc release is still notably slower on some operations than older releases. My test case is a large project named RTEMS (a real-time OS), that we wish to import into darcs (at work) to better track our own additions and modifications. To repeat, download two adjacent releases, e.g.

[Haskell-cafe] Re: darcs 2.4 release candidate 2

2010-02-19 Thread Ben Franksen
Ben Franksen wrote: b...@sarun[1]: .../rtems/rtems-4.9.0 time darcs whatsnew -l Well, it is still running after 18 minutes! Top reports something like PID USER PR NI VIRT RES SHR S %CPU %MEMTIME+ COMMAND 5702 ben 20 0 1112m 933m 3628 R 92.2 28.3 18:26.08 darcs

[Haskell-cafe] Re: darcs 2.4 release candidate 2

2010-02-19 Thread Ben Franksen
Ben Franksen wrote: b...@sarun[1]: .../rtems/rtems-4.9.0 /usr/local/bin/darcs --version 2.2.1 (release) b...@sarun[1]: .../rtems/rtems-4.9.0 time /usr/local/bin/darcs whatsnew -l # ...long output elided... /usr/local/bin/darcs whatsnew -l 381,45s user 6,34s system 92% cpu 7:00,90 total

[Haskell-cafe] Re: Re[2]: Threading and FFI

2010-02-18 Thread Ben Franksen
Yves Parès wrote: But there are two things that remain obscure: First, there is my situation: int the main thread, I call to some C functions binded through FFI. All of them are marked 'unsafe', except one, which is internally supposed to make pauses with 'usleep'. I then execute in another

[Haskell-cafe] Re: Threading and FFI

2010-02-17 Thread Ben Franksen
Yves Parès wrote: I've also discovered something interesting: when I link with the 'threaded' runtime, but let the program use only one core (with '+RTS -N1'), the problem disappears. How comes? The whole thing remains a mystery, because I think what I'm trying to do is quite common...

[Haskell-cafe] Re: Pattern matching, and bugs

2009-12-21 Thread Ben Franksen
Jochem Berndsen wrote: András Mocsáry wrote: *My concern* is about predictable failure of sw written in Haskell. To illustrate it let's see a Haskell pattern matching example: And in Haskell pattern matching: switch 1 = Unchecked switch 2 = Checked switch 3 = Unknown Let's

[Haskell-cafe] Re: Re: Allowing hyphens in identifiers

2009-12-16 Thread Ben Franksen
Daniel Fischer wrote: Am Montag 14 Dezember 2009 01:44:16 schrieb Richard O'Keefe: Where is it written that aesthetic judgements are _entirely_ a matter of personal preference? I think you could find that written in many texts on aesthetic relativism. Doesn't matter, though. Of course,

[Haskell-cafe] Re: fgetc and fputc equivalents

2009-12-09 Thread Ben Franksen
John D. Earle wrote: Although much work has apparently gone into providing support for manipulation binary data I was unable to uncover a Haskell equivalent of the C fgetc and fputc functions. The Haskell equivalents work with Unicode character streams, not bytes words etcetera. I did find a

[Haskell-cafe] Re: ANN: hakyll-0.1

2009-12-08 Thread Ben Franksen
Ketil Malde wrote: minh thu not...@gmail.com writes: Why should your code be licensed under GPL? I think your code is covered by whatever license you wish. An aggregate work, on the other hand, would need to be covered by the GPL, and all source code would have to be available under GPL

[Haskell-cafe] Re: The Transient monad

2009-12-08 Thread Ben Franksen
+1 Alberto G. Corona wrote: Hi haskell cafe: concerning Stable Names http://www.haskell.org/ghc/docs/6.10.4/html/libraries/base/System-Mem-StableName.html makeStableName :: a - IO (StableName a) I Did not test fully my proposal, and I´m thinking aloud, Just to inpire others and

[Haskell-cafe] Re: New Hackage category: Error Handling

2009-12-07 Thread Ben Franksen
Michael Snoyman wrote: On Mon, Dec 7, 2009 at 9:53 PM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Mon, 7 Dec 2009, Michael Snoyman wrote: I also think that in an earlier mail I answered, that errors can leave you with corrupt data, say invalid file handles, memory pointers,

[Haskell-cafe] Re: Re: ANNOUNCE: Blueprint 0.1 -- PREVIEW

2009-12-06 Thread Ben Franksen
Gregory Crosswhite wrote: On Dec 4, 2009, at 11:02 AM, Ben Franksen wrote: Gregory Crosswhite wrote: I have posted Blueprint to Hackage so that people can see what I have done and possibly play with it. Very interesting, this. However, I could not build it. I get [...] At the moment you need

[Haskell-cafe] Re: New Hackage category: Error Handling

2009-12-06 Thread Ben Franksen
Michael Snoyman wrote: On Sun, Dec 6, 2009 at 12:55 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Sun, 6 Dec 2009, Michael Snoyman wrote: I think there are plenty of examples like web servers. A text editor with plugins? I don't want to lose three hours worth of work

[Haskell-cafe] Re: ANNOUNCE: Blueprint 0.1 -- PREVIEW

2009-12-04 Thread Ben Franksen
Gregory Crosswhite wrote: I have posted Blueprint to Hackage so that people can see what I have done and possibly play with it. Very interesting, this. However, I could not build it. I get b...@sarun[2]: ~/tmp cabal install blueprint Resolving dependencies... cabal: There is no installed

[Haskell-cafe] Re: implementing recursive let

2009-11-28 Thread Ben Franksen
Hi Ryan, first, to get this out of the way, you wrote: Also, your definition of Function seems to have problems with scoping; unless you intended to make a dynamically scoped language, No, absolutely not! In fact, the whole exercise has been born out of frustration with certain ad-hoc

[Haskell-cafe] Re: Re: implementing recursive let

2009-11-27 Thread Ben Franksen
Ben Franksen wrote: Ok, it seems I have a version that does what I want. It is not very elegant, I have to manually wrap/unwrap the ErrorT stuff just for the Val case, but at least it seems to work. Here it goes: eval (Var x) = Eval $ ErrorT $ do env - get v - case M.lookup x env

[Haskell-cafe] Re: Re: Re: implementing recursive let

2009-11-27 Thread Ben Franksen
Ryan Ingram wrote: The problem is that ErrorT makes any argument to mdo *much* more strict, and therefore much more likely to loop. This is because each action needs to know whether the previous action was successful before it can continue. Thanks, you are confirming what I suspected. I

[Haskell-cafe] Re: implementing recursive let

2009-11-26 Thread Ben Franksen
Ben Franksen wrote: My problem is that I still don't understand why this is so! I know of course that pattern matching is strict, but I thought this should be ok here, since I evaluate the declarations _before_ the body, so when evaluation of the body demands the variable, it will be defined

[Haskell-cafe] Re: Re: implementing recursive let

2009-11-26 Thread Ben Franksen
Derek Elkins wrote: On Wed, Nov 25, 2009 at 3:48 PM, Ben Franksen ben.frank...@online.de What am I missing? The problem is the liftM2 in the Let branch of eval. You are executing the body while making the bindings, so you are trying to look up x while you are still trying to bind it. One

[Haskell-cafe] Re: implementing recursive let

2009-11-25 Thread Ben Franksen
Derek Elkins wrote: The following code works fine for me, so it seems you are missing some details that may help. [...snip code...] Thank you! Indeed I did simplify the code when writing the message -- because I thought that those other bits could not possibly be at fault... ;-) *trying out

[Haskell-cafe] Re: ANNOUNCE: feldspar-language

2009-11-25 Thread Ben Franksen
Emil Axelsson wrote: Henning Thielemann skrev: On Fri, 6 Nov 2009, Emil Axelsson wrote: Henning Thielemann skrev: I'm trying to get realtime signal processing with Haskell for long. I make progress, but slowly. Has Ericsson ever thought about using Haskell itself for signal processing?

[Haskell-cafe] implementing recursive let

2009-11-24 Thread Ben Franksen
I am trying to write an interpreter for a very simple untyped functional language. I have a problem with mutually recursive let expressions, for which my interpreter loops :( This is a code snippet from the eval function: eval :: Expr - Eval Value eval (Let decls body) = mdo let

[Haskell-cafe] Re: Re: cvs.haskell.org down? haskell-mode abandoned?

2009-10-22 Thread Ben Franksen
Johan Tibell wrote: I just wanted to say that I'd be really happy to see haskell-mode in code.haskell.org. I think it will make it easier for people to hack on it. Another option is http://patch-tag.com/ Cheers Ben ___ Haskell-Cafe mailing list

[Haskell-cafe] Re: is proof by testing possible?

2009-10-12 Thread Ben Franksen
Joe Fredette wrote: Really? How? That sounds very interesting, I've got a fair knowledge of basic topology, I'd love to see an application to programming... Compactness is one of the most powerful concepts in mathematics, because on the one hand it makes it possible to reduce many infinite

[Haskell-cafe] Re: Re: is proof by testing possible?

2009-10-12 Thread Ben Franksen
Joe Fredette wrote: That has got to be the single awesomest thing I have ever seen ever... I was dumbfounded, too, when I first read about this. BTW, and completely off-topic: if you like this, you might have fun too with Conor McBride's discovery that data types can be differentiated, and the

[Haskell-cafe] Re: Re: What *is* a DSL?

2009-10-12 Thread Ben Franksen
S. Doaitse Swierstra wrote: This problem of dynamically transforming grammars and bulding parsers out of it is addressed in: @inproceedings{1411296, author = {Viera, Marcos and Swierstra, S. Doaitse and Lempsink, Eelco}, title = {Haskell, do you read me?: constructing and composing

[Haskell-cafe] Re: How do I get this done in constant mem?

2009-10-11 Thread Ben Franksen
mf-hcafe-15c311...@etc-network.de wrote: On Sat, Oct 10, 2009 at 11:11:24PM +0200, Daniel Fischer wrote: No, readFile reads the file lazily. hm? oh, you are right, now that i fixed all the other problems in my code readFile isn't a problem any more either... (-: (but then how does it

[Haskell-cafe] Re: What *is* a DSL?

2009-10-11 Thread Ben Franksen
Ben Franksen wrote: Next thing I'll try is to transform such a grammar into an actual parser... Which I also managed to get working. However, this exposed yet another problem I am not sure how to solve. The problem manifests itself with non-left-factored rules like Number ::= Digit Number

Re: [Haskell-cafe] Haskell Weekly News: Issue 134 - October 10, 2009

2009-10-11 Thread Ben Franksen
Patrick LeBoutillier wrote: Could/should the Haskell Weekly News be posted to the beginners list as well? I normally don't follow haskell-cafe (too much traffic and generally above my level I must admit...), but I like to follow what's going on in the Haskell community. I find reading the

[Haskell-cafe] Re: What *is* a DSL?

2009-10-11 Thread Ben Franksen
Ben Franksen wrote: Ben Franksen wrote: Next thing I'll try is to transform such a grammar into an actual parser... Which I also managed to get working. First, before all this talking to myself here is boring you to death, please shout and I'll go away. Anyway, at least one person has

[Haskell-cafe] Re: What *is* a DSL?

2009-10-10 Thread Ben Franksen
Robert Atkey wrote: A deep embedding of a parsing DSL (really a context-sensitive grammar DSL) would look something like the following. I think I saw something like this in the Agda2 code somewhere, but I stumbled across it when I was trying to work out what free applicative functors were.

[Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-09 Thread Ben Franksen
Joe Fredette wrote: A ring is an abelian group in addition, with the added operation (*) being distributive over addition, and 0 annihilating under multiplication. (*) is also associative. Rings don't necessarily need _multiplicative_ id, only _additive_ id. Yes, this is how I learned it in

[Haskell-cafe] Re: Re: What *is* a DSL?

2009-10-09 Thread Ben Franksen
Emil Axelsson wrote: Ben Franksen skrev: minh thu wrote: 2009/10/7 Günther Schmidt gue.schm...@web.de: I've informally argued that a true DSL -- separate from a good API -- should have semantic characteristics of a language: binding forms, control structures, abstraction, composition. Some

[Haskell-cafe] Re: Num instances for 2-dimensional types

2009-10-07 Thread Ben Franksen
Daniel Fischer wrote: Am Montag 05 Oktober 2009 16:29:02 schrieb Job Vranish: In what way is it not a number? If there's a natural[1] implementation of fromInteger, good. If there isn't, *don't provide one*. fromInteger _ = error Not sensible is better than doing something strange. [1]

[Haskell-cafe] Re: better way to do this?

2009-10-07 Thread Ben Franksen
Eugene Kirpichov wrote: Or you can use an effect system (however that doesn't give you the opportunity of overriding IO functions, but I think that providing such an opportunity with the means you suggest (splitting IO into many sub-monads) is not going to be usable in the large scale) By

[Haskell-cafe] Re: What *is* a DSL?

2009-10-07 Thread Ben Franksen
minh thu wrote: 2009/10/7 Günther Schmidt gue.schm...@web.de: I've informally argued that a true DSL -- separate from a good API -- should have semantic characteristics of a language: binding forms, control structures, abstraction, composition. Some have type systems. That is one

[Haskell-cafe] Re: Cal, Clojure, Groovy, Haskell, OCaml, etc.

2009-10-02 Thread Ben Franksen
Hong Yang wrote: Good libraries are not enough for a language to go beyond mere existence. There must exist good documents, i.e., good tutorials, good books, and good explanations and examples in the libraries, etc, that are easy for people to learn and use. In my humble opinion, Haskell has a

  1   2   3   >