x86_64 dynamic / PIC

2019-10-03 Thread Donn Cave
I'm trying to get GHC 8.6.3 running on 64-bit Haiku, cross compiling from 32-bit Haiku. (UNIX-like OS, gcc 7.) The build died when it started trying link up 64 bit .dyn_o, with ld.bfd: utils/hsc2hs/dist-install/build/Main.dyn_o: relocation R_X86_64_PC32 can not be used when making a shared

Re: GHC 8.8.1 and cabal-install version

2019-09-10 Thread Donn Cave
> What operating system are you on? is it possible for you to use one of the > binaries from http://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/ in > the meantime? It's Haiku, not exactly one of the major operating systems. I'm not in any hurry, I suppose I'll just let it rest and check

Re: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 and cabal-install version

2019-09-09 Thread Donn Cave
> https://www.haskell.org/ghc/blog/20190825-ghc-8.8.1-released.html says > > cabal-install users should note that cabal-install-3.0 or later is > required for use with GHC 8.8. I'm not the most sophisticated user of cabal-install ever, but it appears to me that 8.8.1 can't build 3.0.0.0? depends

Re: Thread behavior in 7.8.3

2015-01-17 Thread Donn Cave
Quoth Michael Jones m...@proclivis.com, ... 5) What does -V0 do that makes a problem program run? Well, there's that SIGVTALRM barrage, you may remember we went over that mid-August. I expect there are other effects. Donn ___

Re: 'import ccall unsafe' and parallelism

2014-08-14 Thread Donn Cave
I'm no judge of what's true about safe and unsafe, but this account of the system has at least to my ear the ring of authenticity: http://blog.melding-monads.com/2011/10/24/concurrency-and-foreign-functions-in-the-glasgow-haskell-compiler/ The FFI section is short and readable. With respect to

Re: Odd FFI behavior

2014-08-13 Thread Donn Cave
[ ... re -V0 ] Thanks, this solved the problem. I would like to know more about what the signals are doing, and what am I giving up by disabling them? My hope is I can then go back to the dll expert and ask why this is causing their library a problem and try to see if they can solve the

Re: Odd FFI behavior

2014-08-12 Thread Donn Cave
... Because the failures are not general in that they target one particular value, and seem to be affected by time, it makes me wonder if there is some subtle Haskell run time issue. Like, could the garbage collector be interacting with things? Does anyone have an idea what kind of things

Re: [Haskell-cafe] Errors in non-monadic code

2013-08-19 Thread Donn Cave
jabolo...@google.com, MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 In-Reply-To: CAKFCL4VfY-Dz3Xo9ZUZ_SmfRQ2nLGDLbovU=suf1-ssnqvs...@mail.gmail.com References: CAKFCL4VfY-Dz3Xo9ZUZ_SmfRQ2nLGDLbovU=suf1-ssnqvs...@mail.gmail.com quoth Brandon Allbery, Even in IO, exceptions should be

Re: [Haskell-cafe] Alternative name for return

2013-08-07 Thread Donn Cave
quoth Richard A. O'Keefe, ... If you're familiar with *English* rather than, say, the C family of programming languages, return isn't _that_ bad, there is certainly nothing about the word that suggests providing a value. The RFC822 headers of your email suggest that you use a Macintosh

Re: [Haskell-cafe] Alternative name for return

2013-08-07 Thread Donn Cave
quoth Richard A. O'Keefe Check the OED. Most of its meaning are about _turning back_, _resuming_, _reverting_. Yielding or making a profit is not at all about providing a value, but about money going out AND COMING BACK. It's the coming back part that makes it a return. Yes. Return means

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-23 Thread Donn Cave
quoth David Thomas davidleotho...@gmail.com, It strikes me as unlikely static analysis would be confused by shadowing. Not to mention that the example only created two expressions of type IO Fd? (I.e., no file descriptors were opened, let alone leaked.) But in any case, I would have guessed

Re: [Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guardsloops]

2013-07-10 Thread Donn Cave
quoth Alberto G. Corona, Let is recursive because, unlike in the case of other languages, variables are not locations for storing values, but the expressions on the right side of the equality themselves. And obviously it is not possible for a variable-expression to be two expressions at the

Re: [Haskell-cafe] Non-recursive let [Was: GHC bug? Let with guardsloops]

2013-07-10 Thread Donn Cave
quoth Andreas Abel andreas.a...@ifi.lmu.de, ... I would doubt that nhc98 would interpret let xs = 0 : xs differently than ghc if it implemented anything close to the Haskell 98 standard. What I (so vaguely) remember was a compile error, for some reuse of an identifier where GHC permitted

Re: [Haskell-cafe] createProcess interferes with sockets?

2013-04-23 Thread Donn Cave
quoth Evan Laforge qdun...@gmail.com, ... and it still waits for the subprocess to complete. Actually, it looks like it's the client's hGetContents, since hGetChar comes back immediately. I guess that's understandable, but even hGetLine blocks. In the version I was looking at, if I change

Re: [Haskell-cafe] createProcess interferes with sockets?

2013-04-22 Thread Donn Cave
quoth Evan Laforge qdun...@gmail.com, ... Oh I see, because the subprocess inherits the socket connection. That makes sense, though it's tricky. Tricky tricky unix. Why does fork() have to be so complicated? Well, it's very elegant really. It's one of the tools UNIX gives you to decompose

Re: [Haskell-cafe] createProcess interferes with sockets?

2013-04-21 Thread Donn Cave
Quoth Evan Laforge qdun...@gmail.com, sleep = Process.createProcess (Process.proc sleep [5]) sleep = Process.createProcess ((Process.proc sleep [5]) {Process.close_fds = True}) - Because the client uses buffered I/O (hGetContents in this case, but hGet-anything would be the same), it

Re: [Haskell-cafe] Overloading

2013-03-12 Thread Donn Cave
On Mar 13, 2013, at 12:54 AM, Richard A. O'Keefe o...@cs.otago.ac.nz wrote: The interesting challenge here is that we should have Date + Period - Date Date - Period - Date Period + Date - Date Period - Date - ILLEGAL Period + Period - DeriodPeriod - Period -

Re: [Haskell-cafe] Overloading

2013-03-10 Thread Donn Cave
Peter Caspers pcaspers1...@gmail.com, data Month = January | ... ok, I will try to change my code in that direction. The idea is clear. To whatever extent these algebraic data types do map to integer values for your purposes, you can implement that by making Month an instance of Enum.

Re: [Haskell-cafe] Question about forkIO

2013-02-28 Thread Donn Cave
Quoth C K Kashyap ckkash...@gmail.com, ... Say I have a haskell function 'f' that does a forkIO and starts an action a. I create a DLL of this haskell code and inovke f from C. Can I expect the a to continue to run once f has returned to C? Once control returns to f's caller, outside of the

Re: [Haskell-cafe] How to return a network connection to C

2013-02-28 Thread Donn Cave
Quoth C K Kashyap ckkash...@gmail.com, I am using http://hackage.haskell.org/package/connection. So I create network connection in Haskell getConnection :: IO Connection I'd like this connection to be returned to C so that subsequent calls from C can send in the connection handle.

Re: [Haskell-cafe] How to return a network connection to C

2013-02-28 Thread Donn Cave
Quoth C K Kashyap ckkash...@gmail.com, Hey Donn ... when you say, implement the IO in C, you also imply implementing the SSL stuff too right? Yes, if you need encrypted I/O from C. Donn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] What is a Haskell way to implement flags?

2013-02-19 Thread Donn Cave
Quoth Branimir Maksimovic bm...@hotmail.com, In C usual way is to set some bit in integer variable by shifting or oring, and than check flag integer variable by anding with particular flag value. What is Haskell way? Of course you may do the very same thing, if you like. I think if there's

Re: [Haskell-cafe] FunPtr to C function with #arguments determined atruntime?

2013-02-17 Thread Donn Cave
Quoth Ryan Newton rrnew...@gmail.com, The scenario is pretty simple. I generate C code at runtime. I compile it to a .so. I know how many arguments it expects (but only at runtime), and I get a FunPtr back from 'dlsym'. How do I call it? I was hoping there would be some Raw lower level

Re: [Haskell-cafe] FunPtr to C function with #arguments determined atruntime?

2013-02-17 Thread Donn Cave
Quoth Ryan Newton rrnew...@gmail.com, ... Anyway, in this case it wasn't *too *painful to just generate a bunch of extra boilerplate C functions for (1) creating a data structure to hold the arguments, (2) loading them in one at a time, and (3) deallocating the structure when the call is done.

Re: [Haskell-cafe] ifdef based on which OS you're on

2013-02-16 Thread Donn Cave
As counterpoint to Vincent Hanquez' note about the certificate store on MacOS Windows, I'd like to cast some doubt on the notion that you can reliably find the cert store here on Linux or the *BSDs. So, if my experience with platforms like that is any guide, you'd rather not hard code this value

Re: [Haskell-cafe] FFI - Approaches to C/C++

2013-01-31 Thread Donn Cave
Quoth Casey Basichis caseybasic...@gmail.com, ... I am using several other C++ libraries for which there are no existing bindings and no Haskell alternative packages that are even remotely close. Are you suggesting it would be better to write all my own FFI bindings for all the needed

Re: [Haskell-cafe] How can I avoid buffered reads?

2012-12-06 Thread Donn Cave
Quoth Brandon Allbery allber...@gmail.com, On Thu, Dec 6, 2012 at 3:24 PM, Tristan Seligmann mithra...@mithrandi.netwrote: On 29 Nov 2012 12:27 PM, Leon Smith leon.p.sm...@gmail.com wrote: System.Posix.IO and Foreign.This appears to work, but for better or worse, it is using blocking

Re: [Haskell-cafe] Blocking IO FIFOs

2012-10-21 Thread Donn Cave
From Jason Dusek jason.du...@gmail.com, ... If I could somehow arrange to detect EOF when /tmp/exitpipe is closed, then I might as well redirect 1 and 2 to FIFOs and wait for them to EOF, collecting the output. However, all of my experiments suggest that there is simply no way in Haskell to

Re: [Haskell-cafe] Blocking IO FIFOs

2012-10-20 Thread Donn Cave
Quoth Jason Dusek jason.du...@gmail.com, ... For my application, it's important to be able to run multiple queries against the same Bash session. Waiting for Bash to shut down is thus not a viable way to finalize the response. You could redirect to disk files and also use a pipe to wait for

Re: [Haskell-cafe] Getting PID of a child process

2012-10-18 Thread Donn Cave
Quoth Jason Dusek jason.du...@gmail.com, Using `System.Process.runInteractiveProcess', I can start a process and get a handle to it: runInteractiveProcess :: FilePath - [String] - Maybe FilePath - Maybe [(String, String)] - IO (Handle, Handle, Handle, ProcessHandle)

Re: [Haskell-cafe] forkProcess, forkIO, and multithreaded runtime

2012-10-16 Thread Donn Cave
Since we're talking about forkIO here - not forkOS - is it possible to control the use of OS threads to avoid this problem? As I understand it, the problem is with real OS threads. A program running entirely in multiple `green' threads will fork to the same set of threads in the same state,

Re: [Haskell-cafe] Issue building ghc on NetBSD/amd64

2012-10-16 Thread Donn Cave
Quoth lhagan lhaga...@gmail.com, Just tried changing the flag in build.mk, but I get the same error. Also, I'm pretty sure I need the --enable-hc-boot flag. Without it, I get: configure: error: GHC is required unless bootstrapping from .hc files. Unless I've missed a whole lot of progress on

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-14 Thread Donn Cave
Quoth Alexander Kjeldaas alexander.kjeld...@gmail.com, See access(2) ... a classic code smell in UNIX programming, for the same reasons. We can solve this problem in an efficient way that works well, and equally well, on any POSIX platform that supports F_CLOEXEC on pipes, and I can't think of

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-13 Thread Donn Cave
Quoth Evan Laforge qdun...@gmail.com, ... ... or at least make sure the haskell version doesn't suffer from problems fixed in the python one. Exactly. This morning I'm reading suggested solutions that would work only some of the time, or on only some platforms, which wouldn't be satisfactory

Re: [Haskell-cafe] createProcess running non-existent programs

2012-08-13 Thread Donn Cave
Quoth Brandon Allbery allber...@gmail.com, On Mon, Aug 13, 2012 at 10:23 AM, Donn Cave d...@avvanta.com wrote: Though speaking of platforms, I guess one large headache would be what to do about Microsoft operating systems. Given the unusual Microsoft provides APIs that work

Re: [Haskell-cafe] do vs. pattern matching

2012-08-04 Thread Donn Cave
On Sat, Aug 4, 2012 at 7:05 AM, Alexander Solla alex.so...@gmail.com wrote: On Fri, Aug 3, 2012 at 11:34 PM, Matthew wonderzom...@gmail.com wrote: ... With do notation, I can write something like this: do foo - callFoo x bar - callBar x return (baz)

Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needsyour help

2012-07-13 Thread Donn Cave
Quoth Cale Gibbard: Personally I don't see why everyone appears to prefer the syntax with \ in it over just the obvious case section syntax which was originally proposed. case of { ... } ... Does anyone else agree? Yes. I don't see this as an `anonymous function' in any special sense,

Re: [Haskell-cafe] Call to arms: lambda-case is stuck and needsyourhelp

2012-07-13 Thread Donn Cave
Quoth Wolfgang Jeltsch g9ks1...@acme.softbase.org, ... What is an anonymous function? A function that has no name, that is, a function that is not assigned to an identifier. So (+ 1), \x - x + 1, and any lambda case are all anonymous functions. All right, that more general definition works for

RE: Call to arms: lambda-case is stuck and needs your help

2012-07-10 Thread Donn Cave
I think it's very helpful if lambdas start with a lambda, which to me suggests \case. I'd be interested to hear that explained a little further. To me it isn't obvious that `case of' is `a lambda', but it's obvious enough what it is and how it works (or would work) - it's `case' with type a -

Re: Call to arms: lambda-case is stuck and needs your help

2012-07-05 Thread Donn Cave
The `multi-clause lambda' seems more elegant, if the syntactical problems could be worked out. I mean, unnamed functions are thus just like named functions, something that you'd probably think to try just as soon as you needed the feature. I don't understand the issues well enough with the

Re: [Haskell-cafe] Martin Odersky on What's wrong with Monads

2012-06-28 Thread Donn Cave
To be fair, while it's great that Functor et al. are available to help solve problems like that with a Tree data structure, in the present context it mostly shows that a trivial example was used to illustrate the problem. Unless I'm missing how this generic fold functionality solves the more

Re: [Haskell-cafe] Haskell integration with C/C++ (GSOC)

2012-04-05 Thread Donn Cave
Quoth Anthony Cowley acow...@seas.upenn.edu, ... I think this is a consequence of line buffering rather than a bug. If you write your own increment function in Haskell, you get the same behavior. If you `hSetBuffering stdout NoBuffering` before your `putStr` call, you should get the behavior

Re: [Haskell-cafe] thread killed

2012-04-04 Thread Donn Cave
On Wed, Apr 4, 2012 at 6:37 AM, tsuraan tsur...@gmail.com wrote: What sorts of things can cause a thread to get an asynchronous thread killed exception? I've been seeing rare, inexplicable thread killed messages in my Snap handlers for a long time, but they aren't from Snap's timeout code.

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-17 Thread Donn Cave
Quoth Jeff Shaw shawj...@msu.edu, ... I'm thinking that side effects are really only necessary because Haskell programs expect to mutate the state of a computer outside of the haskell program. I'm not a computer scientist, but in English, side effect is an effect that accompanies some other

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-17 Thread Donn Cave
Quoth Chris Smith cdsm...@gmail.com, ... The answer is that side effects has become something of a figure of speech, and now has a specialized meaning in programming languages. When we're talking about different uses of the word function in programming languages, side effects refer to any

Re: [Haskell-cafe] Theoretical question: are side effects necessary?

2012-03-16 Thread Donn Cave
Quoth KC kc1...@gmail.com, On Fri, Mar 16, 2012 at 7:44 PM, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: ... but the question of purity of a program - in my opinion - concerns the program, and nothing else. You might be thinking of software engineering purity. Or software

Re: How to work around GHC bug

2012-03-14 Thread Donn Cave
Quoth Volker Wysk p...@volker-wysk.de, ... I'll report this as a bug in the GHC Trac. But for now, I need to work around the problem somehow. The encoders in GHC.IO.Encoding all work on buffers. How do I recode the command line, in order to get proper Unicode strings? Data.Text might work

Re: [Haskell-cafe] Preventing leaked open file descriptors whencatching exceptions

2012-02-21 Thread Donn Cave
Quoth Bryan O'Sullivan b...@serpentine.com, On Tue, Feb 21, 2012 at 8:16 AM, Ryan Newton rrnew...@gmail.com wrote: FYI, lsof confirms that there are indeed many many open connections to the same FIFO: Like all of the lowest-level I/O functions, openFD just gives you back an integer, and

Re: [Haskell-cafe] Stable pointers: use of cast to/from Ptr

2012-02-13 Thread Donn Cave
Quoth =?ISO-8859-1?Q?Yves_Par=E8s?= yves.pa...@gmail.com, You mean I have to use a type like StablePtr (IORef Stuff)? Because there I can only peek (deRefStablePtr) the pointer, not poke it. I take it I should return to C a StablePtr to the new value if I don't want to use IORefs... Yes ...

Re: [Haskell-cafe] Stable pointers: use of cast to/from Ptr

2012-02-12 Thread Donn Cave
Quoth Yves Pares, ... If StablePtrs cannot have their pointed value modified (either C or Haskell-side), that mostly limits their interest, doesn't it? I'm not sure I follow what's happening in the two cases you mention, but in case it helps, I use StablePtr as a way to smuggle Haskell values

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-09 Thread Donn Cave
Quoth Evan Laforge qdun...@gmail.com, ... The non-composing non-abstract updates are what bug me, and make me scatter about tons of 'modifyThis' functions, both for composability and to protect from field renames. So ... at the risk of stating the obvious, is it fair to say the root of this

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution -record update

2012-02-09 Thread Donn Cave
Quoth AntC anthony_clay...@clear.net.nz, ... No, Donn, it's not the lack of syntax, it's the lack of semantics for first- class (polymorphic) record update. And there's very little that's obvious. Ah, you're right, I certainly shouldn't have used the word syntax there. But just to be clear on

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-09 Thread Donn Cave
Quoth Evan Laforge qdun...@gmail.com, On Thu, Feb 9, 2012 at 12:49 PM, Donn Cave d...@avvanta.com wrote: ... For example, in a better world you could write stuff like modifyConfig :: (Config - a) - (a - a) - Config - Config modifyConfig fr fv a = a { fr = fv (fr a) } upTempo config

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution -record update

2012-02-09 Thread Donn Cave
Quoth AntC anthony_clay...@clear.net.nz, Donn Cave donn at avvanta.com writes: ... The narrow issue we're trying to address is namespacing, and specifically name clashes: two different records with the same named field. ... Now in return for me answering that, please answer the questions in my

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-06 Thread Donn Cave
Quoth AntC anthony_clay...@clear.net.nz, ... It was a surprise to me that dot without spaces around is still legal syntax for function composition. It isn't even unusual. You can find stuff like fromIntegral.ord in packages downloaded to build cabal-install for example. It graphically appeals

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-02-03 Thread Donn Cave
Quoth AntC anthony_clay...@clear.net.nz, ... We're on the slippery slope! Where will it end? And now that I've found it, I so love: customer.lastName.tail.head.toUpper-- Yay! ... compared to present practice, with where dot is function composition only -

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-01-31 Thread Donn Cave
Quoth AntC anthony_clay...@clear.net.nz, ... My proposal is that field selection functions be just ordinary functions, and dot notation be just function application(tight-binding). Then: object.fieldfuncmethod == fieldfuncmethod object (Subject to the tight binding for the dot.) And

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-01-30 Thread Donn Cave
Quoth Steve Horne sh006d3...@blueyonder.co.uk, On 30/01/2012 07:09, Donn Cave wrote: ((separate . crack . .smallEnd) egg).yolk (f egg).yolk where f = separate . crack . .smallEnd Scary - that .smallEnd worries me. It's like a field is being referenced with some magical context from nowhere

Re: [Haskell-cafe] Exceeding OS limits for simultaneous socketconnections

2012-01-30 Thread Donn Cave
Quoth Marc Weber marco-owe...@gmx.de, ... - replace getContents conn by something strict and close the handle yourself? (not sure about this.) That's an easy one to try, right? Just force evaluation of the getContents return value, in getMsg. If lazy I/O is the culprit here, it wouldn't be

Re: [Haskell-cafe] [Haskell Cafe] strict version of Haskell - doesit exist?

2012-01-30 Thread Donn Cave
Quoth Richard O'Keefe o...@cs.otago.ac.nz, ... On the other hand, a designed-to-be-strict language-and-libraries with close-to-Haskell *syntax* would be nice. I recently described F# as combining the beauty of Caml with the functional purity of C# -- both of course are like the snakes of

Re: [Haskell-cafe] Some thoughts on Type-Directed Name Resolution

2012-01-29 Thread Donn Cave
On 28/01/2012 13:00, Paul R wrote: ... All this dot syntax magic frankly frightens me. Haskell, as a pure functionnal language, requires (and allows !) a programming style that just does not mix well with object oriented practices. Stretching the syntax to have the dot feel

Re: [Haskell-cafe] named pipe interface

2012-01-14 Thread Donn Cave
Quoth Serge D. Mechveliani mech...@botik.ru, By openFile you, probably, mean openFd. Yes, sorry! Another point is the number of open files, for a long loop. ... toA_IO = openFd toA WriteOnly Nothing defaultFileFlags ... When applying axiomIO in a loop of 9000 strings, it breaks:

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Donn Cave
Quoth Serge D. Mechveliani mech...@botik.ru, [ ... why in Haskell instead of FFI ... ] Because it is a direct and the simplest approach. Why does one need a foreign language, if all the needed functions are in the standard Haskell library? The GHC Haskell library makes some compromises with

Re: [Haskell-cafe] named pipe interface

2012-01-13 Thread Donn Cave
Quoth Serge D. Mechveliani mech...@botik.ru, ... Initially, I did the example by the Foreign Function Interface for C. But then, I thought But this is unnatural! Use plainly the standard Haskell IO, it has everything. So, your advice is return to FFI ? Well, it turns out that the I/O system

Re: Composition operator [was: Re: Records in Haskell]

2012-01-12 Thread Donn Cave
Quoth Evan Laforge qdun...@gmail.com, ... ... Groups that are reluctant to make formatting changes for fear of confusing revision history are really going to hate that one. I think a lively discussion would also be possible over whether exotic characters are suitable at all. But this is a

Re: Composition operator [was: Re: Records in Haskell]

2012-01-12 Thread Donn Cave
Quoth Greg Weber g...@gregweber.info, On Thu, Jan 12, 2012 at 6:23 PM, Malcolm Wallace malcolm.wall...@me.comwrote: So, who is up for proposing centred dot as the new record-field syntax? We don't need to make this change overnight. The new records system will be turned on by an extension.

Re: Composition operator [was: Re: Records in Haskell]

2012-01-12 Thread Donn Cave
Quoth Brandon Allbery allber...@gmail.com, On Thu, Jan 12, 2012 at 17:14, Donn Cave d...@avvanta.com wrote: Spaces or unicode would be the worst idea yet, but hopefully that isn't what you meant. Thing is, I think the spaces idea is considered acceptable because it's *already there*. Take

Re: Composition operator [was: Re: Records in Haskell]

2012-01-12 Thread Donn Cave
Quoth Brandon Allbery allber...@gmail.com, ... Seems obvious to me: on the one hand, there should be a plain-ASCII version of any Unicode symbol; on the other, the ASCII version has shortcomings the Unicode one doesn't (namely the existing conflict between use as composition and use as

Re: [Haskell-cafe] How to terminate the process group of aprocesscreated with createProcess?

2012-01-12 Thread Donn Cave
Quoth Brandon Allbery allber...@gmail.com, On Thu, Jan 12, 2012 at 06:56, André Scholz andre.sch...@uni-bremen.dewrote: gid - createProcessGroup pid but i get the error message: createProcessGroup: permission denied the documentation for terminateProcess is incorrect and

Re: [Haskell-cafe] named pipe interface

2012-01-12 Thread Donn Cave
Quoth Serge D. Mechveliani mech...@botik.ru, (I wonder: is this for beginn...@haskell.org ?) No, not really! As already mentioned, the use of UnsafePerformIO goes a little beyond what I think is its intended purpose, and I think you might have better luck here with a test program that

Re: [Haskell-cafe] How to terminate the process group of a processcreated with createProcess?

2012-01-11 Thread Donn Cave
Quoth Brandon Allbery allber...@gmail.com, ... terminateProcess passes on the semantics of kill(2); on SVID-compliant (and I think POSIX.1-compliant) systems, the negative of the process group leader's process ID is used to signal the process group. Note that you may need to arrange for your

Re: [Haskell-cafe] On the purity of Haskell

2011-12-30 Thread Donn Cave
Quoth Steve Horne sh006d3...@blueyonder.co.uk, On 30/12/2011 10:41, Bardur Arantsson wrote: This doesn't sound right to me. To me, a side effect is something which happens as a (intended or unintended) consequence of something else. An effect which you want to happen (e.g. by calling a

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Donn Cave
Quoth Steve Horne sh006d3...@blueyonder.co.uk, On 29/12/2011 08:48, Heinrich Apfelmus wrote: ... Well, it's a matter of terminology: impure /= has side effects. The ability of a language to describe side effects is not tied to its (im)purity. Again, purity refers to the semantics of

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Donn Cave
Quoth Gregg Reynolds d...@mobileink.com, On Wed, Dec 28, 2011 at 2:44 PM, Heinrich Apfelmus apfel...@quantentunnel.de wrote: The beauty of the IO monad is that it doesn't change anything about purity. Applying the function bar :: Int - IO Int to the value 2 will always give the same

Re: [Haskell-cafe] Windows: openFile gives permission deniedwhenfilein use

2011-12-29 Thread Donn Cave
Quoth Antoine Latter aslat...@gmail.com, ... Would this program then loop: append fromFilePath toFilePath = do str - readFile fromFile writeFile toFile str if 'from' and 'to' where the same file? Currently the locking prevents this. Do you mean, locking makes that work, or just makes

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Donn Cave
Quoth Steve Horne sh006d3...@blueyonder.co.uk, On 29/12/2011 18:41, Chris Smith wrote: ... On Thu, 2011-12-29 at 10:04 -0800, Donn Cave wrote: We can talk endlessly about what your external/execution results might be for some IO action, but at the formulaic level of a Haskell program it's

Re: [Haskell-cafe] Windows: openFile gives permission denied whenfilein use

2011-12-29 Thread Donn Cave
Quoth Antoine Latter aslat...@gmail.com, ... http://www.haskell.org/pipermail/libraries/2011-October/016978.html ... wherein Ian Lynagh proposed to remove this feature and let the programmer enforce locking or not, as in other programming languages' base I/O libraries. This met with

Re: [Haskell-cafe] Windows: openFile gives permission denied whenfile in use

2011-12-29 Thread Donn Cave
Quoth Andrew Coppin andrewcop...@btinternet.com, On 29/12/2011 04:29 AM, Antoine Latter wrote: ... This bug and its discussion is similar, but not identical: http://hackage.haskell.org/trac/ghc/ticket/4363 This one has been rumbling on for ages. As others have said, the Report demands that

Re: [Haskell-cafe] On the purity of Haskell

2011-12-29 Thread Donn Cave
Quoth Gregg Reynolds d...@mobileink.com, .. A minor point maybe, but germane to the original post (I hope). It isn't - I mean, I'm not really sure what your point is, but the example really returns the same IO value, not just one of the same type. Consider an example with implementation:

Re: Records in Haskell

2011-12-28 Thread Donn Cave
Quoth Greg Weber g...@gregweber.info, ... Many of the built-in record proposals seem more ambitious (create a new record from an existing one, generalize in some other direction). More power or generalization could be very useful, but it can wait for later - Haskell's records are glaringly bad

Re: Records in Haskell

2011-12-28 Thread Donn Cave
Quoth Greg Weber g...@gregweber.info, On Wed, Dec 28, 2011 at 2:12 PM, Donn Cave d...@avvanta.com wrote: ... I would think row polymorphism is a must-have. Perhaps if you want *extensible* records. If you would like to make some progress with records in the near future rather than keeping

Re: [Haskell-cafe] If you'd design a Haskell-like language, what would you do different?

2011-12-26 Thread Donn Cave
Quoth Hans Aberg, ... For example, I set one entry so that typing x |- a becomes x ↦ a, the TeX \mapsto, in Unicode ↦ RIGHTWARDS ARROW FROM BAR U+21A6. It might be tedious to make a lot of entries, though, but something to start with. Something to finish me with, too. I wouldn't be

Re: [Haskell-cafe] How to get Cabal to spit out a .a library suitable for linking into C/Objective-C

2011-12-26 Thread Donn Cave
Sorry about the belated response, but this shouldn't be a problem since it isn't going to be very helpful anyway! I've managed to follow the process described on this page: http://www.haskell.org/haskellwiki/Using_Haskell_in_an_Xcode_Cocoa_project to link Haskell code to a non-Haskell main

Re: [Haskell-cafe] terminateProcess leaves zombie processes around

2011-12-07 Thread Donn Cave
Quoth Felipe Almeida Lessa felipe.le...@gmail.com, On Wed, Dec 7, 2011 at 1:19 PM, Brandon Allbery allber...@gmail.com wrote: They *do* terminate; a zombie is a dead process waiting for its parent to reap it with waitForProcess. There's also some POSIX stuff you can do to have them

Re: [Haskell-cafe] How to get a file path to the program invoked?

2011-12-04 Thread Donn Cave
Quoth wren ng thornton w...@freegeek.org, There was a discussion about this recently over on libraries@, IIRC. The short answer is that, at present, there is no function to give you $0. We'd like to add such a function, but it's not been done yet. Part of the problem is that, as Alexey

Re: IO in the middle

2011-11-17 Thread Donn Cave
I think you're talking about RPC, Remote Procedure Call. A search for that term turns up http://www.haskell.org/haskellwiki/HaXR For things like this, it would make sense to subscribe to haskell-cafe, and post questions there - it's a much more active list that's devoted to ideas about Haskell

Re: [Haskell-cafe] Can't establish subprocess communication

2011-11-13 Thread Donn Cave
As mentioned by the first person to follow up, you need to set line buffering in the copier program. It's filling up its buffer while you write small lines to it - unlike the test run at the terminal prompt, where it's connected to a TTY device and therefore behaved differently. In a situation

Re: [Haskell-cafe] Getting started on Mac OSX

2011-11-11 Thread Donn Cave
Quoth hstenstrom h.stenst...@gmail.com, I have a book on Haskell, and I've downloaded and installed Haskell Platform for Mac OS X. What do I do now? XCode is a requirement, and I have it, but I don't know how to run it. To begin with, I want to test small examples from the book, using ghc or

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-06 Thread Donn Cave
Quoth John Millikin jmilli...@gmail.com, ... One is to give low-level access, using abstractions as close to the real API as possible. In this model, unix would provide functions like [[ rename :: ByteString - ByteString - IO () ]], and I would know that it's not going to do anything weird to

Re: [Haskell-cafe] control-c only caught once -- bug?

2011-10-30 Thread Donn Cave
Quoth Brian Johnson brianjohnsonhaskellc...@gmail.com, ... On further thought, there is something sensible here: the RTS might crash while trying to exit. I propose, for POSIX environments, the following change to SIGINT handling: * SIGINT is transformed into UserInterrupt during normal

Re: [Haskell-cafe] control-c only caught once -- bug?

2011-10-29 Thread Donn Cave
brianjohnsonhaskellc...@gmail.com wrote: The second time I press control-c, it isn't caught -- the program exits instead. Why? I don't know why. Same behavior on my platform (Haiku.) While I imagine someone intimately acquainted with RTS signal handling might be able to explain it, I think

Re: [Haskell-cafe] instance Enum Double considered notentirelygreat?

2011-09-27 Thread Donn Cave
Quoth Chris Smith cdsm...@gmail.com, ... So that's what this is about: do we think of Float as an approximate real number type, or as an exact type with specific values. If the latter, then of course you exclude the value that's larger than the upper range. If the former, then using

Re: [Haskell-cafe] instance Enum Double considerednotentirelygreat?

2011-09-27 Thread Donn Cave
Quoth Chris Smith cdsm...@gmail.com, ... I certainly don't agree that wanting the exact value from a floating point type is a reasonable expectation. The *only* way to recover those results is to do the math with the decimal or rational values instead of floating point numbers. You'll get

Re: [Haskell-cafe] instance Enum Double considered not entirelygreat?

2011-09-26 Thread Donn Cave
Quoth Richard O'Keefe o...@cs.otago.ac.nz, [ ... re Why would you write an upper bound of 0.3 on a list if you don't expect that to be included in the result? ] Because upper bounds are *UPPER BOUNDS* and are NOT as a rule included in the result. If you write [0,2..9] you - DO

Re: [Haskell-cafe] instance Enum Double considered not entirelygreat?

2011-09-20 Thread Donn Cave
Quoth Chris Smith cdsm...@gmail.com, ... As for Enum, if someone were to want a type class to represent an enumeration of all the values of a type, then such a thing is reasonable to want. Maybe you can even reasonably wish it were called Enum. But it would be the *wrong* thing to use as a

Re: [Haskell-cafe] efficient chop

2011-09-14 Thread Donn Cave
Quoth Ivan Lazar Miljenovic ivan.miljeno...@gmail.com, Why the extra case for go? The otherwise guard can be part of the second case... I noticed that myself, so I thought let's see if it's just a matter of style that comes out the same after compilation ... ... and after a few minutes

Re: [Haskell-cafe] Trouble with readProcess

2011-08-11 Thread Donn Cave
Quoth Charles-Pierre Astolfi c...@crans.org, readProcess cmd [opt1,opt2] seems to execute the following: $ cmd opt1 opt2 That is usually fine, but I'm using an external program that doesn't understand the quotes, so I need to execute instead: $ cmd opt1 opt2 How should I do that? I think

Re: [Haskell-cafe] Trouble with readProcess

2011-08-11 Thread Donn Cave
Quoth Charles-Pierre Astolfi c...@crans.org, I've found my mistake: I was calling readProcess cmd [-p -t] instead of readProcess cmd [-p,-t] That would do it. Not sure what are the semantics of quotation in this case, though. And I'm pretty sure my analysis is wrong because of that :) The

Re: [Haskell-cafe] State of play with Haskell-Cocoa (Objective-C)bindings?

2011-08-01 Thread Donn Cave
Quoth Luke Evans l...@eversosoft.com, I'm planning to start an Objective-C/Cocoa project and would like to write it in Haskell as much as possible. Of course, I can contrive to split the project into app logic (Haskell) and UI (Objective-C) with some sort of minimal interface between them;

Re: [Haskell-cafe] XCode Dependency for HP on Mac - old XCodeversions

2011-07-27 Thread Donn Cave
Quoth Clive Brettingham-Moore hask...@brettingham-moore.net, To get XCode on my 10.6 machine, I... I had quite a hunt recently to find the most recent XCode for my not-so-recent mac... so I'll share what I found: Were you able to look on your install CD? Donn

  1   2   3   4   >