Re: [Haskell-cafe] newtype a Constraint?

2013-03-12 Thread Max Bolingbroke
On 12 March 2013 13:18, Roman Cheplyaka r...@ro-che.info wrote: Is there a way to newtype a constraint? Imagine a type class parameterised over constraints. What do I do if I want multiple instances for (essentially) the same constraint? It would make sense to add support for this to newtype

Re: [Haskell-cafe] cabal install choosing an older version

2013-01-25 Thread Max Bolingbroke
On 25 January 2013 14:46, Ozgur Akgun ozgurak...@gmail.com wrote: The latest versions of ansi-terminal and hspec do not work together. Cabal picks the latest ansi-terminal (0.6) first, then the latest hspec that doesn't conflict with this choice is 0.3.0. If this happens because the dependency

Re: Dynamic libraries by default and GHC 7.8

2012-12-06 Thread Max Bolingbroke
On 27 November 2012 17:00, Ian Lynagh i...@well-typed.com wrote: We would love for Windows to be one of the platforms, but currently we can't do it on Windows. So unless that changes, Windows will not be one of the platforms, correct. So if I understand correctly, the problem here arises

Re: Dynamic libraries by default and GHC 7.8

2012-12-06 Thread Max Bolingbroke
On 6 December 2012 09:27, Max Bolingbroke batterseapo...@hotmail.com wrote: I'm not sure how to convince GNU ld to link us such a DLL, though. It might be possible to hack it in by linking against verylongdummydllname.dll and then having GHC search for that string in DLL/EXE returned by LD

Re: Dynamic libraries by default and GHC 7.8

2012-12-06 Thread Max Bolingbroke
On 6 December 2012 10:05, Max Bolingbroke batterseapo...@hotmail.com wrote: I've tested this by hand and it seems like it works: the absolute paths you hack into the import library are not messed with by the later link step. The resulting executables run flawlessly. Job done. To continue

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-18 Thread Max Bolingbroke
On 10 November 2011 14:35, Simon Marlow marlo...@gmail.com wrote: Agreed. Committed. I'm wondering if we should also have hSetLocaleEncoding, hSetFileSystemEncoding :: TextEncoding -  IO () and change localeEncoding, fileSystemEncoding :: IO TextEncoding. hSetFileSystemEncoding in

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-10 Thread Max Bolingbroke
On 10 November 2011 00:17, Ian Lynagh ig...@earth.li wrote: On Wed, Nov 09, 2011 at 03:58:47PM +, Max Bolingbroke wrote: (Note that the above outlined problems are problems in the current implementation too Then the proposal seems to me to be strictly better than the current system

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-10 Thread Max Bolingbroke
On 9 November 2011 16:29, Simon Marlow marlo...@gmail.com wrote: Ok, so since we need something like  makePrintable :: FilePath - String arguably we might as well make that do the locale decoding.  That's certainly a good point... You could, but getArgs :: IO [String], not :: IO [FilePath].

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-09 Thread Max Bolingbroke
On 8 November 2011 11:43, Simon Marlow marlo...@gmail.com wrote: Don't you mean 1 is what we have? Yes, sorry! Failing to roundtrip in some cases, and doing so silently, seems highly suboptimal to me.  I'm sorry I didn't pick up on this at the time (Unicode is a swamp :). I *can* change the

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-09 Thread Max Bolingbroke
On 7 November 2011 17:32, John Millikin jmilli...@gmail.com wrote: I am also not convinced that it is possible to correctly implement either of these functions if their behavior is dependent on the user's locale. FWIW it's only dependent on the users locale because whether glibc iconv detects

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-09 Thread Max Bolingbroke
On 9 November 2011 13:11, Ian Lynagh ig...@earth.li wrote: If we aren't going to guarantee that the encoded string is unicode, then is there any benefit to encoding it in the first place? (I think you mean decoded here - my understanding is that decode :: ByteString - String, encode :: String -

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-09 Thread Max Bolingbroke
On 9 November 2011 11:02, Simon Marlow marlo...@gmail.com wrote: The performance overhead of all this worries me.  withCString has taken a huge performance hit, and I think there are people who wnat to know that there aren't several complex encoding/decoding passes between their Haskell code

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-06 Thread Max Bolingbroke
On 6 November 2011 04:14, John Millikin jmilli...@gmail.com wrote: For what it's worth, on my Ubuntu system, Nautilus ignores the locale and just treats all paths as either UTF8 or invalid. To me, this seems like the most reasonable option; the concept of locale encoding is entirely vestigal,

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-03 Thread Max Bolingbroke
On 2 November 2011 21:46, Ganesh Sittampalam gan...@earth.li wrote: The workaround you propose seems a little complex and it might be a bit problematic that 100% roundtripping can't be guaranteed even once your fix is applied. I can understand this perspective, although the roundtripping as

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-02 Thread Max Bolingbroke
On 1 November 2011 20:13, John Millikin jmilli...@gmail.com wrote: $ ghci-7.2.1 GHC import System.Directory GHC getDirectoryContents path-test [\161\165,\61345\61349,..,.] GHC readFile path-test/\161\165 world\n GHC readFile path-test/\61345\61349 *** Exception: path-test/: openFile:

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-02 Thread Max Bolingbroke
On 2 November 2011 10:03, Jean-Marie Gaillourdet j...@gaillourdet.net wrote: As far as I know, not all encodings are reversable. I.e. there are byte sequences which are invalid utf-8. Therefore, decoding and re-encoding might not return the exact same byte sequence. The PEP 383 mechanism

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-02 Thread Max Bolingbroke
On 2 November 2011 09:37, Max Bolingbroke batterseapo...@hotmail.com wrote: On 1 November 2011 20:13, John Millikin jmilli...@gmail.com wrote: $ ghci-7.2.1 GHC import System.Directory GHC getDirectoryContents path-test [\161\165,\61345\61349,..,.] GHC readFile path-test/\161\165 world\n

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-02 Thread Max Bolingbroke
On 2 November 2011 13:53, Max Bolingbroke batterseapo...@hotmail.com wrote: I think the only way to fix this last case in general is to fix iconv itself, so I'm going to see if I can get a patch upstream. Fixing it for people with UTF-8 locales should be enough for 99% of users, though. One

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-02 Thread Max Bolingbroke
On 2 November 2011 17:15, John Millikin jmilli...@gmail.com wrote: What package does this patch -- unix, directory, something else? The base package. The problem lay in the implementation of GHC.IO.Encoding.fileSystemEncoding on non-Windows OSes. Maybe I'm misunderstanding, but it sounds like

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-02 Thread Max Bolingbroke
On 2 November 2011 16:29, Ian Lynagh ig...@earth.li wrote: If I understand correctly, you use U+EF00-U+EFFF to encode the characters 0-255 when they are not a valid part of the UTF8 stream. Yes. So why not encode U+EF00 (which in UTF8 is 0xEE 0xBC 0x80) as U+EFEE U+EFBC U+EF80, and so on?

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-02 Thread Max Bolingbroke
On 2 November 2011 19:13, Ian Lynagh ig...@earth.li wrote: [snip some stuff I didn't understand. I think I made the mistake of entering a Unicode discussion] Sorry, perhaps that was too opaque! The problem is that if we commit to support occurrences of the private-use codepoint 0xEF80 then what

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-02 Thread Max Bolingbroke
On 2 November 2011 20:16, Ian Lynagh ig...@earth.li wrote: Are you saying there's a bug that should be fixed? You can choose between two options: 1. Failing to roundtrip some strings (in our case, those containing the 0xEFNN byte sequences) 2. Having GHC's decoding functions return strings

Re: [Haskell-cafe] Hackage feature request: E-mail author when a package breaks

2011-11-02 Thread Max Bolingbroke
On 2 November 2011 01:08, Diego Souza dso...@bitforest.org wrote: The idea is simple: there are many different platforms that would be to expensive for one to support. So they ask the community for help, and then distribute the load amongst the perl community. Duncan and co have been working

Re: [Haskell-cafe] Problem with TemplateHaskell

2011-11-02 Thread Max Bolingbroke
On 2 November 2011 07:42, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote: How to avoid the name changing? Maybe you should use nameBase rather than show? Max ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-01 Thread Max Bolingbroke
Hi Ganesh, On 1 November 2011 07:16, Ganesh Sittampalam gan...@earth.li wrote: Can anyone point me at the rationale and details of the change and/or suggest workarounds? This is my implementation of Python's PEP 383 [1] for Haskell. IMHO this behaviour is much closer to what users expect.For

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-01 Thread Max Bolingbroke
Hi John, On 1 November 2011 17:14, John Millikin jmilli...@gmail.com wrote: GHC 7.2 assumes Linux/BSD paths are text, which 1) silently breaks all existing code and 2) makes it impossible to fix within the given API. Please can you give an example of code that is broken with the new behaviour?

Re: [Haskell-cafe] Hackage feature request: E-mail author when a package breaks

2011-11-01 Thread Max Bolingbroke
On 1 November 2011 09:00, Ketil Malde ke...@malde.org wrote: This is where it stranded the last time, IIRC.  That sentiment makes me a bit uneasy; so you are the official maintainer of a package on Hackage, but you do not want to hear about it when it fails to compile? Don't forget that some

Re: [Haskell-cafe] Hackage feature request: E-mail author when a package breaks

2011-11-01 Thread Max Bolingbroke
On 1 November 2011 10:14, Ketil Malde ke...@malde.org wrote: So, I'd *love* to get an email when my packages fail to build, but I will accept that other people have a more sensitive relationship with their inbox.  (I assume that the people who raise this objection - Max and Yitzchak - belong

Re: [Haskell-cafe] is Haskell missing a non-instantiating polymorphic case?

2011-10-31 Thread Max Bolingbroke
On 23 October 2011 06:48, Adam Megacz meg...@cs.berkeley.edu wrote: The title might be a bit more provocative than necessary. I'm starting to suspect that there are very useful aspects of the parametricity of System F(C) which can't be taken advantage of by Haskell in its current state.  To

Re: Discussion about the ConstraintKinds extension

2011-10-22 Thread Max Bolingbroke
On 20 October 2011 19:51, bob zhang bobzhang1...@gmail.com wrote: That would be great. Would you mind send me a patch, or commit it to the source tree. I've made this change in commit 5ff06e90f56b7da00f4fec74358b2e736133c263. Hope that helps. Max

Re: Discussion about the ConstraintKinds extension

2011-10-20 Thread Max Bolingbroke
On 18 October 2011 13:49, bob zhang bobzhang1...@gmail.com wrote:     In my contrived example the definition of class C is like this         class C c where { foo :: c Int = }         class C B = B a where { ...}     will this pass under your proposal? Yes I would allow this to pass. If

Re: Discussion about the ConstraintKinds extension

2011-10-18 Thread Max Bolingbroke
On 18 October 2011 02:25, bob zhang bobzhang1...@gmail.com wrote:      take a contrived example,      class C B = B a where      here B :: * - Constraint,  I think this definition is reasonable, since B does not appears in the      first position of the context. I think you are getting an

Re: [Haskell-cafe] About the ConstraintKinds extension

2011-10-18 Thread Max Bolingbroke
On 18 October 2011 02:17, bob zhang bobzhang1...@gmail.com wrote:      But I found a problem which I thought would be made better, plz correct me if I am wrong For those who only subscribe to Haskell-Cafe, Bob posted a very similar thread to ghc-users, which I replied to here with a suggestion

Re: [Haskell-cafe] SPECIALIZE in the presence of constraints

2011-09-25 Thread Max Bolingbroke
On 26 September 2011 01:37, Nicu Ionita nicu.ion...@acons.at wrote: 1. how can the compiler (here ghc) know which function to expose as the correct generic search function? There must be two search functions generated, one generic and its specialization. Yes, exactly. If you have: {-#

Re: [Haskell-cafe] Smarter do notation

2011-09-05 Thread Max Bolingbroke
On 5 September 2011 02:38, Sebastian Fischer fisc...@nii.ac.jp wrote: These are important questions. I think there is a trade-off between supporting many cases and having a simple desugaring. We should find a sweet-spot where the desugaring is reasonably simple and covers most idiomatic cases.

Re: [Haskell-cafe] Smarter do notation

2011-09-05 Thread Max Bolingbroke
On 5 September 2011 08:35, Max Bolingbroke batterseapo...@hotmail.com wrote: (If you do want to support the type checker only generating requests for an Applicative constraint you could just insist that user code writes pure instead of return, in which case this would be quite easy

Re: Parallel --make (GHC build times on newer MacBook Pros?)

2011-08-29 Thread Max Bolingbroke
On 27 August 2011 09:00, Evan Laforge qdun...@gmail.com wrote: Right, that's probably the one I mentioned.  And I think he was trying to parallelize ghc internally, so even compiling one file could parallelize.  That would be cool and all, but seems like a lot of work compared to just

Re: Panic when using syb with GHC API

2011-08-26 Thread Max Bolingbroke
On 26 August 2011 09:22, Simon Peyton-Jones simo...@microsoft.com wrote: The underlying issue is that before type checking GHC (obviously) doesn't know the types of things, while afterwards it does.  The whole HsSyn tree is parameterised over the types of identifiers:  Parsed:       HsExpr

Re: [Haskell-cafe] Make shared library - questions

2011-08-26 Thread Max Bolingbroke
On 26 August 2011 13:52, Sergiy Nazarenko nazarenko.ser...@gmail.com wrote: /usr/local/lib/ghc-6.12.3/base-4.2.0.2/libHSbase-4.2.0.2.a(Conc__270.o): relocation R_X86_64_32 against `base_GHCziConc_ensureIOManagerIsRunning1_closure' can not be used when making a shared object; recompile with

Re: Superclass defaults

2011-08-22 Thread Max Bolingbroke
On 21 August 2011 21:03, Alexey Khudyakov alexey.sklad...@gmail.com wrote: I don't completely understant how does it work. Does client need to enable language extension to get default instances? I think that the extension would only be required to *define them*, not for them to be generated.

Re: Cheap and cheerful partial evaluation

2011-08-22 Thread Max Bolingbroke
On 21 August 2011 19:20, Edward Z. Yang ezy...@mit.edu wrote: And no sooner do I send this email do I realize we have 'inline' built-in, so I can probably experiment with this right now... You may be interested in my related ticket #5029: http://hackage.haskell.org/trac/ghc/ticket/5059 I don't

Re: [Haskell-cafe] ANNOUNCE: Chell: A quiet test runner (low-output alternative to test-framework)

2011-08-11 Thread Max Bolingbroke
On 11 August 2011 05:17, John Millikin jmilli...@gmail.com wrote: This is just a quick package I whipped up out of frustration with test-framework scrolling an error message out of sight, for the millionth time. Patches to make test-framework less noisy (either by default or with a flag) will

Re: [Haskell-cafe] ANNOUNCE: Chell: A quiet test runner (low-output alternative to test-framework)

2011-08-11 Thread Max Bolingbroke
On 11 August 2011 15:49, John Millikin jmilli...@gmail.com wrote: I tried, actually, but couldn't figure out how to separate running the test from printing its output. All the attempted patches turned into huge refactoring marathons. Just FYI test-framework already has exactly this split

Re: [Haskell-cafe] Analyzing slow performance of a Haskell program

2011-08-07 Thread Max Bolingbroke
On 7 August 2011 06:15, Chris Yuen kizzx2+hask...@gmail.com wrote: I am mainly interested in making the Haskell version perform comparatively to the C# version. Right now it is at least 5x slower so obviously I am missing something obvious) You have a map call which is immediately consumed by

Re: [Haskell-cafe] Diagnose stack space overflow

2011-07-04 Thread Max Bolingbroke
On 4 July 2011 16:44, Logo Logo sarasl...@gmail.com wrote: Hi, For the following error: Stack space overflow: current size 8388608 bytes. Use `+RTS -Ksize -RTS' to increase it. I want to find out the culprit function and rewrite it tail-recursively. Is there a way to find out which

Re: [Haskell-cafe] Exclusive mode in openFile

2011-06-28 Thread Max Bolingbroke
On 28 June 2011 17:50, Gracjan Polak gracjanpo...@gmail.com wrote: It seems I'm not allowed to open same file both for writing and for reading: This behaviour is part of the Haskell 98 specification (section 21.2.3, http://www.haskell.org/onlinereport/io.html): Implementations should enforce

Re: [Haskell-cafe] Exclusive mode in openFile

2011-06-28 Thread Max Bolingbroke
On 28 June 2011 18:56, Gracjan Polak gracjanpo...@gmail.com wrote: Anyway, where do I find an 'openFileShared' function? Packages unix/Win32 do not have obvious leads... Perhaps the functions in System.Posix.IO do what you want?

Re: MonoLocalBinds and hoopl

2011-06-19 Thread Max Bolingbroke
On 14 June 2011 14:28, Simon Peyton-Jones simo...@microsoft.com wrote: I must say I'm inclined to adopt this idea.  Any comments from others? This is something I suggested at the time you submitted let should not be generalised. I'm in favour of it, and from personal experience believe that this

Re: [Haskell-cafe] Data.List / Map: simple serialization?

2011-06-09 Thread Max Bolingbroke
If you want plain text serialization, writeFile output.txt . show and fmap read (readFile output.txt) should suffice... Max On 9 June 2011 08:23, Dmitri O.Kondratiev doko...@gmail.com wrote: Hello, Please advise on existing serialization libraries. I need a simple way to serialize Data.List

Re: [Haskell-cafe] Data.List / Map: simple serialization?

2011-06-09 Thread Max Bolingbroke
Hi Dmitri, On 9 June 2011 09:13, Dmitri O.Kondratiev doko...@gmail.com wrote: I wonder how Haskell will distribute memory between the buffer for sequential element access (list elements, map tree nodes) and memory for computation while reading in list, Data.Map from file? Your list only has

Re: [Haskell-cafe] HUnit false-positive stumper

2011-06-06 Thread Max Bolingbroke
On 6 June 2011 02:34, KQ qu...@sparq.org wrote: The shock here is that there was only one failure, whereas the False ~=? True should have failed. I'm not sure, but at a glance it looks you might have the usual problem where compiling your test with optimisations means that GHC optimises away

Re: [Haskell-cafe] HUnit false-positive stumper

2011-06-06 Thread Max Bolingbroke
On 6 June 2011 16:18, Jimbo Massive jimbo.massive-hask...@xyxyx.org wrote: Or is this bad behaviour due to HUnit doing something unsafe? I think it may be related to this bug: http://hackage.haskell.org/trac/ghc/ticket/5129 The suggested fix is to change HUnit to define assertFailure with

Re: [Haskell-cafe] HUnit false-positive stumper

2011-06-06 Thread Max Bolingbroke
On 6 June 2011 16:43, Max Bolingbroke batterseapo...@hotmail.com wrote: The suggested fix is to change HUnit to define assertFailure with throwIO, but the latest source code still uses throw: Err, I mean http://hackage.haskell.org/packages/archive/HUnit/latest/doc/html/src/Test-HUnit-Lang.html

Re: [Haskell-cafe] [Maybe Int] sans Nothings

2011-05-23 Thread Max Bolingbroke
On 23 May 2011 17:20, michael rice nowg...@yahoo.com wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? http://haskell.org/hoogle/?hoogle=%3A%3A+%5BMaybe+a%5D+-%3E+%5Ba%5D Data.Maybe.catMaybes is what you want :-) Cheers, Max

Re: [Haskell-cafe] Using cmake with haskell

2011-05-15 Thread Max Bolingbroke
On 15 May 2011 18:46, Rogan Creswick cresw...@gmail.com wrote: On Sun, May 15, 2011 at 8:21 AM, Malcolm Wallace malcolm.wall...@me.com wrote: On 5/14/11 6:12 PM, Nathan Howell wrote: Waf supports parallel builds and works with GHC without too much trouble. I'm surprised no-one has yet

Re: [Haskell-cafe] Debugging with gdb?

2011-04-13 Thread Max Bolingbroke
On 13 April 2011 07:59, Svante Signell svante.sign...@telia.com wrote: As I don't know anything about Haskell, can I make a stupid question: Is there any method to create debug symbols for a Haskell program, and is it possible to debug with gdb? You cannot create debug symbols. Things that are

Re: -DDEBUG and testsuite

2011-04-06 Thread Max Bolingbroke
On 6 April 2011 12:04, Edward Z. Yang ezy...@mit.edu wrote: The ill fated commit I made yesterday was a partial attempt to address some of the problems: basically, it boils down to DEBUG blocks that induce extra debugging output that the test framework doesn't know about. You didn't used to

Re: [Haskell-cafe] Encoding of Haskell source files

2011-04-04 Thread Max Bolingbroke
On 4 April 2011 11:34, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: If there's only a single encoding recognised, UTF-8 surely should be the one (though perhaps Windows users might disagree, iirc, Windows uses UCS2 as standard encoding). Windows APIs use UTF-16, but the encoding of

Re: [Haskell-cafe] Encoding-aware System.Directory functions

2011-03-31 Thread Max Bolingbroke
On 31 March 2011 09:13, Ketil Malde ke...@malde.org wrote: -- | Try to decode a FilePath to Text, using the current locale encoding. If -- the filepath is invalid in the current locale, it is decoded as ASCII and -- any non-ASCII bytes are replaced with a placeholder. Why not map them to

Re: [Haskell-cafe] DSL for task dependencies

2011-03-31 Thread Max Bolingbroke
On 31 March 2011 12:44, oliver mueller oliver.muel...@gmail.com wrote: it's a bit sad to see that shake is completely off the table since it really looked good. I think Neil has had trouble getting permission to release the code, which is why I wrote openshake. maybe openshake can fill in

Re: [Haskell-cafe] Encoding-aware System.Directory functions

2011-03-30 Thread Max Bolingbroke
On 30 March 2011 07:52, Michael Snoyman mich...@snoyman.com wrote: I could manually do something like (utf8Decode . S8.pack), but that presumes that the character encoding on the system in question is UTF8. So two questions: Funnily enough I have been thinking about this quite hard recently,

Re: [Haskell-cafe] Encoding-aware System.Directory functions

2011-03-30 Thread Max Bolingbroke
On 30 March 2011 10:20, Tako Schotanus t...@codejive.org wrote: http://www.haskell.org/pipermail/libraries/2009-August/012493.html I took from this discussion that FilePath really should be a pair of the actual filename ByteString, and the printable String (decoded from the ByteString, with

Re: OPTIONS_GHC -prof -auto-all

2011-03-28 Thread Max Bolingbroke
On 26 March 2011 21:02, Henning Thielemann g...@henning-thielemann.de wrote: to the mentioned module, but GHC rejects this, because the profiler options are not allowed in the OPTIONS pragma. According to According to http://www.haskell.org/ghc/docs/7.0.1/html/users_guide/flag-reference.html

Re: GHC7 (on OSX.5)

2011-03-20 Thread Max Bolingbroke
On 20 March 2011 19:01, wren ng thornton w...@freegeek.org wrote: Are these warnings I should be concerned about? No. These warnings just tell you explicitly that SpecConstr has exceeded the limit of specialisations that GHC is happy to generate. They are totally harmless and just mean that

Re: [Haskell-cafe] [Haskell] Linker flags for foreign export.

2011-03-14 Thread Max Bolingbroke
On 13 March 2011 22:02, Jason Dusek jason.du...@gmail.com wrote:  Is there any case in which the empty string would be unsafe? AFAIK this stuff is only used to setup the +RTS options and some of the stuff in System.Environment. I think that the contents of the program name will only cause

Re: trac ticket spam

2011-03-12 Thread Max Bolingbroke
On 31 January 2011 16:54, Simon Marlow marlo...@gmail.com wrote: On 31/01/2011 16:45, Claus Reinke wrote: Is there any way to have a moderate first comment by new submitter policy for trac, to avoid the kind of ticket spam we have at the moment? They seem to have started commenting on

Re: ghc-7.0.2 on macports wanted

2011-03-11 Thread Max Bolingbroke
On 10 March 2011 17:51, Christian Maeder christian.mae...@dfki.de wrote: Why does the base package depend on iconv only on macs? iconv is not needed under linux or solaris (unless you install haskeline, which is not in the platform. I don't have access to a Linux box to check, but according to

Re: [Haskell-cafe] ContT and ST stack

2011-03-11 Thread Max Bolingbroke
On 10 March 2011 17:55, Bas van Dijk v.dijk@gmail.com wrote: On 10 March 2011 18:24, Yves Parès limestr...@gmail.com wrote: Why has the operator (.) troubles with a type like (forall s. ST s a)? Why can't it match the type 'b' in (.) definition? As explained by the email from SPJ that I

Re: [Haskell-cafe] [Haskell] Linker flags for foreign export.

2011-03-10 Thread Max Bolingbroke
On 10 March 2011 04:04, Jason Dusek jason.du...@gmail.com wrote:  I'm trying to hew relatively close to Duncan Coutts'  blog posting in working through this; so I have different  code and a new Makefile: Starting with your code I've managed to make it work (OS X 10.6, GHC 7). The Makefile is:

Re: [Haskell-cafe] [Haskell] Linker flags for foreign export.

2011-03-09 Thread Max Bolingbroke
Hi Jason,  Following your advice, I was able to get a working main,  linking the .o's (no attempt at an SO this time) with GHC. I haven't tried it, but how about this: 1. Use ghc to link a standard Haskell executable that requires your libraries. Run the link step with -v so you can see the

Re: [Haskell-cafe] [Haskell] Linker flags for foreign export.

2011-03-08 Thread Max Bolingbroke
Hi Jason, On 8 March 2011 05:28, Jason Dusek jason.du...@gmail.com wrote:    gcc -g -Wall -O2 -fPIC -Wall -o import \      -I/usr/lib/ghc-6.12.1/include/ \      import.c exports.so In my experience, the easiest way to do this is to use gcc to build object files from C source files, and then

Re: [Haskell-cafe] ANNOUNCE: cinvoke 0.1 released

2011-03-07 Thread Max Bolingbroke
Hi Remi, On 6 March 2011 13:38, Remi Turk rt...@science.uva.nl wrote: I am happy to finally announce cinvoke 0.1, a binding to the C library cinvoke[1], allowing functions to be loaded and called whose names and types are not known before run-time. As the author of the libffi package

Re: [Haskell-cafe] Linking errors when compiling projects with the ncurses-0.2 library

2011-03-06 Thread Max Bolingbroke
Hi Roman, 2011/3/5 Román González romanand...@gmail.com: ld: warning: in /Users/roman/.homebrew/lib/libncursesw.dylib, file was built for unsupported file format which is not the architecture being linked (i386) This is the problem. You are using OS X 10.6 and Homebrew is building a 64 bit

Re: [Haskell-cafe] Thoughts on program annotations.

2011-03-03 Thread Max Bolingbroke
On 4 March 2011 06:32, Jason Dusek jason.du...@gmail.com wrote:    --  From https://github.com/solidsnack/bash/blob/c718de36d349efc9ac073a2c7082742c45606769/hs/Language/Bash/Syntax.hs    data Annotated t = Annotated t (Statement t)    data Statement t = SimpleCommand Expression [Expression]

Re: [Haskell-cafe] Rank-2 types in classes

2011-03-02 Thread Max Bolingbroke
On 2 March 2011 09:11, Yves Parès limestr...@gmail.com wrote: class (forall x. Monad (IM i x)) = Impl i where     data IM i :: * - * - * But GHC forbids me to do so. The way I usually work around this is by doing something like the following pattern: {{{ class Monad1 m where return1 :: a

Re: [Haskell-cafe] Rank-2 types in classes

2011-03-02 Thread Max Bolingbroke
2011/3/2 Yves Parès limestr...@gmail.com: Is what I'm trying to do a common technique to type-ensure contexts or are there simpler methods? I don't understand your problem well enough to be able to venture a solid opinion on this. Sorry! What you have detailed so far doesn't sound too complex,

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-23 Thread Max Bolingbroke
On 23 February 2011 05:31, Johan Tibell johan.tib...@gmail.com wrote: On Tue, Feb 22, 2011 at 9:19 PM, Johan Tibell johan.tib...@gmail.com wrote: Initial numbers suggest that lookup gets 3% slower and insert/delete 6% slower. The upside is O(1) size. Can someone come up with a real world

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-23 Thread Max Bolingbroke
On 23 February 2011 12:05, Gregory Collins g...@gregorycollins.net wrote: I've been working on one lately, some preliminary benchmarks:    https://gist.github.com/826935 It's probably a month or two away from a releasable state, but my work-in-progress is substantially faster (4-6X) than

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-23 Thread Max Bolingbroke
On 23 February 2011 16:03, Johan Tibell johan.tib...@gmail.com wrote: Thanks for the examples. Point 3 is interesting but most of the gain there could probably be had by telling the user to use (bigmap `union` smallmap). My guess is that the user has a good idea which argument is

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-23 Thread Max Bolingbroke
On 23 February 2011 21:27, Gwern Branwen gwe...@gmail.com wrote: On Wed, Feb 23, 2011 at 1:18 PM, Johan Tibell johan.tib...@gmail.com wrote: Could you manually look at some of them to see if you find something interesting. In particular `Set.size s == 0` (a common use of size in imperative

Re: cabal install network was: Re: ANNOUNCE: GHC 7.0.2 Release Candidate 2

2011-02-21 Thread Max Bolingbroke
On 21 February 2011 11:50, Christian Maeder christian.mae...@dfki.de wrote: The problem (below) is caused by the new flags  -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 inside hsc2hs that have been added to fix http://hackage.haskell.org/trac/ghc/ticket/4860.

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-21 Thread Max Bolingbroke
On 20 February 2011 03:40, Louis Wasserman wasserman.lo...@gmail.com wrote: I'd like to complain about that, too ;) I'm curious, when do people find that they need a really fast way to get map size? I use them quite a lot, and almost never call length - and when I do, it is typically only to get

Re: [Haskell-cafe] Alex -g

2011-02-20 Thread Max Bolingbroke
On 20 February 2011 19:56, Mihai Maruseac mihai.marus...@gmail.com wrote: Hi, When running Alex -g I get several warning telling me that a bang pattern is required and that the warning will be an error in GHC 6.14. As it happens, that is not an error in GHC 7 (see

Re: Faster Array#/MutableArray# copies

2011-02-18 Thread Max Bolingbroke
On 18 February 2011 01:18, Johan Tibell johan.tib...@gmail.com wrote: C compilers, like gcc, go to great lengths making memcpy fast and I was thinking that we might be able to steal a trick or two from them. I'd like some feedback on these ideas: It seems like a sufficient solution for your

Re: [Haskell-cafe] Sub-optimal [code]

2011-02-16 Thread Max Bolingbroke
On 16 February 2011 21:51, Andrew Coppin andrewcop...@btinternet.com wrote: (Now, if only there was a version that feeds an integer to the monadic action as well... Still, it's not hard to implement.) As simple as: forM [1..x] mk_my_action ___

Re: [Haskell-cafe] Sub-optimal [code]

2011-02-16 Thread Max Bolingbroke
On 16 February 2011 22:48, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: The problem with that is that under certain circumstances the list is shared in nested loops, which was what caused the thread (it was mapM_ and not forM_, but I'd be very surprised if they behaved differently

Re: [Haskell-cafe] upgrading mtl1 to mtl2

2011-02-16 Thread Max Bolingbroke
On 17 February 2011 07:28, Sebastian Fischer fisc...@nii.ac.jp wrote: I must admit I still don't understand your exact problem. Could you help me with an example where using mtl2 requires an additional (Functor m) constraint that is not required when using mtl1? I think the problem is that the

Re: [Haskell-cafe] rewrite rules to specialize function according to type class?

2011-02-15 Thread Max Bolingbroke
2011/2/15 Gábor Lehel illiss...@gmail.com: This is a semi-related question I've been meaning to ask at some point: I suppose this also means it's not possible to write a class, write some rules for the class, and then have the rules be applied to every instance? (I.e. you'd have to write them

Re: [Haskell-cafe] rewrite rules to specialize function according to type class?

2011-02-15 Thread Max Bolingbroke
2011/2/15 Simon Peyton-Jones simo...@microsoft.com: but currently any pragmas in a class decl are treated as attaching to the *default method*, not to the method selector: I see. I didn't realise that that was what was happening. Personally I find this a bit surprising, but I can see the

Re: [Haskell-cafe] rewrite rules to specialize function according to type class?

2011-02-15 Thread Max Bolingbroke
On 15 February 2011 11:23, Roman Leshchinskiy r...@cse.unsw.edu.au wrote: I wouldn't necessarily expect this to guarantee inlining for the same reason that the following code doesn't guarantee that foo gets rewritten to big: foo = bar {-# INLINE bar #-} bar = big It might work with the

Re: [Haskell-cafe] rewrite rules to specialize function according to type class?

2011-02-15 Thread Max Bolingbroke
On 15 February 2011 15:12, Roman Leshchinskiy r...@cse.unsw.edu.au wrote: Ah, but you assume that bar won't be inlined into foo first. Consider that it is perfectly acceptable for GHC to generate this: foo = big {-# INLINE bar #-} bar = big We did ask to inline bar, after all. Well, yes,

Re: [Haskell-cafe] rewrite rules to specialize function according to type class?

2011-02-15 Thread Max Bolingbroke
On 15 February 2011 16:45, Roman Leshchinskiy r...@cse.unsw.edu.au wrote: Only if foo has an INLINE pragma. Otherwise, GHC uses whatever RHS is available when it wants to inline. Ah, I see! Well yes, in that case my workaround is indeed broken in the way you describe, and there is no way to

Re: [Haskell-cafe] Vector library

2011-02-14 Thread Max Bolingbroke
On 14 February 2011 10:19, Pierre-Etienne Meunier pierreetienne.meun...@gmail.com wrote: For instance, it allows you to program a single function that works for any dimensionality of the array. I don't know how vector handles it, but you may be interested to look at the repa library

Re: [Haskell-cafe] rewrite rules to specialize function according to type class?

2011-02-14 Thread Max Bolingbroke
On 14 February 2011 21:43, Patrick Bahr pa...@arcor.de wrote: Am I doing something wrong or is it not possible for GHC to dispatch a rule according to type class constraints? As you have discovered this is not possible. You can write the rule for as many *particular* types as you like, but you

Re: [Haskell-cafe] Sub-optimal

2011-02-14 Thread Max Bolingbroke
On 14 February 2011 21:00, Andrew Coppin andrewcop...@btinternet.com wrote: Is this a known bug? (GHC 6.10.x) It's known to happen when optimising shares what shouldn't be shared. Try compiling with -O2 -fno-cse (if that doesn't help, it doesn't necessarily mean it's not unwanted sharing,

Re: [Haskell-cafe] MonadPeelIO instance for monad transformers on top of forall

2011-02-05 Thread Max Bolingbroke
On 5 February 2011 02:35, Sebastian Fischer fisc...@nii.ac.jp wrote: I have not used monad-peel before so please ignore my comment if I am missing something obvious. The documentation mentions that Instances of MonadPeelIO should be constructed via MonadTransPeel, using peelIO = liftPeel

Re: [Haskell-cafe] MonadPeelIO instance for monad transformers on top of forall

2011-02-05 Thread Max Bolingbroke
On 5 February 2011 04:19, Anders Kaseorg ande...@mit.edu wrote: Just to demonstrate that I didn’t use the triviality of ReaderT (), here’s a less trivial example with ReaderT and StateT: This is superb, thank you! I would never have come up with that :-) It still seems to fail somehow on my

Re: [Haskell-cafe] How to #include into .lhs files?

2011-02-04 Thread Max Bolingbroke
On 4 February 2011 05:03, Michael Snoyman mich...@snoyman.com wrote: My guess (a complete guess) is that the deliterate step is creating a temporary .hs file elsewhere on your filesystem, which is why the CPP step can't find B.hs without a fully-qualified path. That is what is happening (you

Re: [Haskell-cafe] OSX i386/x86 and x86_64 - time to switch supported platforms?

2011-02-04 Thread Max Bolingbroke
On 4 February 2011 02:35, Steve Severance st...@medwizard.net wrote: Wholly support moving OSX to x64. x86 should be supported only on a best effort basis for legacy. Moving from x86 to x64 has advantages and disadvantages from my POV. Advantages: * Able to address more memory * More

Re: [Haskell-cafe] How to #include into .lhs files?

2011-02-04 Thread Max Bolingbroke
On 4 February 2011 05:03, Michael Snoyman mich...@snoyman.com wrote: My guess (a complete guess) is that the deliterate step is creating a temporary .hs file elsewhere on your filesystem, which is why the CPP step can't find B.hs without a fully-qualified path. That is what is happening (you

  1   2   3   4   >