Re: [Haskell-cafe] vector stream fusion, inlining and compilation time

2010-03-10 Thread Max Bolingbroke
This is my understanding: Old story (GHC 6.12.1 (?) and below): 1) Function bodies are only optimised if they are not marked INLINE. The assumption is that INLINE bodies will be inlined and then optimised at the point where they are inlined. 2) Unfoldings are exported in .hi files for functions

Re: [Haskell-cafe] Re: Anyone up for Google SoC 2010?

2010-03-11 Thread Max Bolingbroke
On 11 March 2010 13:42, Andrew Coppin andrewcop...@btinternet.com wrote: Yeah, I thought the IHG recently spent a bunch of money on getting it working on Linux. I gather Windows is a lowER priority (although it IS on the to-do list). AFAIK shared libraries now work on Windows - Ben Lippmeier

Re: [Haskell-cafe] Re: If wishes were horses...

2010-03-12 Thread Max Bolingbroke
On 12 March 2010 10:38, Ketil Malde ke...@malde.org wrote: What should the type look like?  If memory serves, Clean allows bangs in type signatures, something like:  foldl' :: (a - b - a) - !a - [b] - a but I thought it just added a seq under the hood, Thats my understanding too. I did

Re: [Haskell-cafe] explicit big lambdas

2010-03-18 Thread Max Bolingbroke
Hi Paul, You should be able to introduce \Lambda at the source level by writing a type signature with an explicit forall. Similarly you can then instantiate these \Lambdas by using a type signature which is an instance of the foralled type at the use site: ~~~ -- id will get a \Lambda in Core id

Re: [Haskell-cafe] swf flv decoder in haskell

2010-03-29 Thread Max Bolingbroke
I have a project called hswf which provides a Haskell library for roundtripping (i.e. encode . decode and decode . encode are morally equal to the identity function) SWF files. The source is available at http://github.com/batterseapower/hswf/. You are welcome to try it out if it looks useful, with

Re: [Haskell-cafe] my gsoc project topic

2010-03-29 Thread Max Bolingbroke
On 29 March 2010 14:01, Csaba Hruska csaba.hru...@gmail.com wrote: Hi! - Another LLVM related idea is to create a framework to support writing llvm passes in haskell, this should be based on existing llvm haskell binding. This is a cool idea! For bonus points, you could provide a binding to

Re: [Haskell-cafe] Re: GSOC Haskell Project

2010-04-01 Thread Max Bolingbroke
I still believe that it would much simpler to get some stack traces out of GHC by just reporting what chain of thunks we are currently forcing when we get an error. This just requires a way of reifying the existing STG stack in some user-readable way. What it doesn't give you is lexical call

Re: [Haskell-cafe] Re: GSOC Haskell Project

2010-04-01 Thread Max Bolingbroke
On 1 April 2010 18:58, Thomas Schilling nomin...@googlemail.com wrote: On 1 Apr 2010, at 18:39, Mihai Maruseac wrote: Hmm, interesting. If I intend to give it a try, will there be a mentor for a GSOC project? Or should I start doing it alone? I'm sure Simon Marlow could mentor you except

Re: [Haskell-cafe] Hughes' parallel annotations for fixing a space leak

2010-04-04 Thread Max Bolingbroke
On 31 March 2010 20:51, Heinrich Apfelmus apfel...@quantentunnel.de wrote: As I understand it, GHC implements the technique from Sparud's paper, so this is a solved problem. This is not my understanding. As far as I know, the STG machine has a special notion of selector thunks, which represent

Re: [Haskell-cafe] Re: Haskell.org re-design

2010-04-06 Thread Max Bolingbroke
This is a very nice design. However shouldn't other pages e.g. the wiki template be redesigning to match as well? If this is not going to happen, then I would almost prefer sticking to the current design for consistency's sake. On 6 April 2010 20:11, Thomas Schilling nomin...@googlemail.com

Re: [Haskell-cafe] Difficulties installing LLVM bindings

2010-04-09 Thread Max Bolingbroke
On 9 April 2010 18:38, Aran Donohue aran.dono...@gmail.com wrote: Hi Haskell-Cafe, I can't get the LLVM bindings for Haskell to install. Does anyone know what I might need to do? Has anyone seen this error before? Here's the problem: (Installing from latest darcs source) I just tried this on

Re: [Haskell-cafe] Difficulties installing LLVM bindings

2010-04-10 Thread Max Bolingbroke
On 10 April 2010 03:18, Aran Donohue aran.dono...@gmail.com wrote: problems with ghc-pkg.  I think we need to rebuild LLVM forcing 32-mode, but I haven't yet found the results of this. I'd love to hear what you did if you manage to get it going and compile programs. My LLVM checkout was still

Re: [Haskell-cafe] Can't install Criterion package on ghc ..

2010-04-13 Thread Max Bolingbroke
Someone already did, 2 days ago: http://hackage.haskell.org/trac/ghc/ticket/3978 Cheers, Max On 13 April 2010 13:56, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Mozhgan kabiri mozhgan.kab...@gmail.com writes: [8 of 9] Compiling Data.Vector.Algorithms.Intro (

Re: [Haskell-cafe] unboxed types in classes

2010-04-14 Thread Max Bolingbroke
Hi Phyx, instance Foo Int# Int where  bar = iBox What you want is not currently possible, for many of the same reasons that you cannot instantiate polymorphic types (e.g. that of id) at unboxed types. Because you can't then be polymorphic in the a in Foo a b if a might be an unboxed type,

Re: [Haskell-cafe] Floyd Warshall performance (again)

2010-04-16 Thread Max Bolingbroke
For what is is worth: $ ghc -cpp -O2 -ddump-asm Main.hs Main.s $ time ./a.out Allocating ... Allocating ... done real0m39.487s user0m39.258s sys 0m0.150s $ ~/Programming/Checkouts/ghc.llvm/inplace/bin/ghc-stage2 -cpp -fllvm -O2 Main.hs $ time ./a.out Allocating ... Allocating ...

[Haskell-cafe] ANN: test-framework 0.3.0

2010-05-07 Thread Max Bolingbroke
I'm pleased to announce the release of version 0.3 of test-framework (http://hackage.haskell.org/package/test-framework-0.3.0). This package provides a nice test runner for HUnit, QuickCheck 1 and QuickCheck 2 tests. To see a detailed example of the runner in action, please check out our website

Re: [Haskell-cafe] ANN: test-framework 0.3.0

2010-05-08 Thread Max Bolingbroke
On 8 May 2010 02:31, Gregory Collins g...@gregorycollins.net wrote: I don't see this one, although the junit option is there: Argh! I made the release from the wrong branch. I've uploaded v0.3.1 and double-checked that it contains the right functionality. Thanks for the heads-up! Max

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Max Bolingbroke
On 20 May 2010 16:50, Carlos Camarao carlos.cama...@gmail.com wrote: Using the available instances to resolve overloading is a tricky thing, it's very easy to make things break that way. Using the available instances is the natural, in fact the only way, to resolve overloading. AFAIK no

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-20 Thread Max Bolingbroke
On 20 May 2010 20:30, Carlos Camarao carlos.cama...@gmail.com wrote: Consider instances defined in non-imported modules to be visible in the current context is not correct, I think... I was under the impression that this was not specified, because orphans are a bit of an oddity. But naturally

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-21 Thread Max Bolingbroke
On 21 May 2010 01:58, Carlos Camarao carlos.cama...@gmail.com wrote: But this type-correct program would become not typeable if instances such as the ones referred to before (by Daniel Fischer) I was thinking this through, and the situation is more complex than I had thought. It seems that

Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma

2010-05-26 Thread Max Bolingbroke
Hi Carlos, Apologies for the lateness of my reply. On 23 May 2010 02:24, Carlos Camarao carlos.cama...@gmail.com wrote: I think that a notion of orphan instances based on whether an instance is defined or not in the module where the class of the instance is defined is not very nice I broadly

Re: [Haskell-cafe] Optimizations and constant unboxed values

2010-05-28 Thread Max Bolingbroke
Hi, On 28 May 2010 01:22, Pierre-Etienne Meunier pierreetienne.meun...@gmail.com wrote: Then, examining the core (with of course -O3 on) FYI, -O3 is the same as -O2. revealed things like :  (GHC.Prim.*##                  (GHC.Prim.-## 1.0 (GHC.Prim.**## 2.0 -53.0))                  

Re: [Haskell-cafe] Re: Re: What is Haskell unsuitable for?

2010-06-19 Thread Max Bolingbroke
On 19 June 2010 16:06, Maciej Piechotka uzytkown...@gmail.com wrote: The problem is that:  - GHC GC can run at any moment  - It is stop-the-world GC  - There is no upper limit on how long GHC GC will run I have no experience with real-time applications however. Curt Sampson had an

[Haskell-cafe] The mother of all functors/monads/categories

2010-06-27 Thread Max Bolingbroke
I'm wondering if someone can cast some light on a pattern I've come across, which I'm calling the mother of all X pattern after Dan Piponi's blog post (http://blog.sigfpe.com/2008/12/mother-of-all-monads.html). Edward Kmett has also explored these ideas here:

[Haskell-cafe] Re: The mother of all functors/monads/categories

2010-06-27 Thread Max Bolingbroke
By the way, you can use this stuff to solve the restricted monad problem (e.g. make Set an instance of Monad). This is not that useful until we find out what the mother of all MonadPlus is, though, because we really need a MonadPlus Set instance. Code below. Cheers, Max \begin{code} {-#

Re: [Haskell-cafe] The mother of all functors/monads/categories

2010-06-27 Thread Max Bolingbroke
On 27 June 2010 14:30, Roman Leshchinskiy r...@cse.unsw.edu.au wrote: In that case, isn't D just the dictionary for (X d) and a value of type (d a)? I.e., couldn't we always define it as: data D d a where { D :: X d = d a - D d a } I wondered about this, but how would you write e.g. the

Re: [Haskell-cafe] The mother of all functors/monads/categories

2010-06-27 Thread Max Bolingbroke
On 27 June 2010 16:07, Felipe Lessa felipe.le...@gmail.com wrote: On Sun, Jun 27, 2010 at 10:54:08AM +0100, Max Bolingbroke wrote: Example 2: Codensity is the mother of all Monads I thought the continuation monad was the mother of all monads. :) I actually already referenced Dan's article

Re: [Haskell-cafe] The mother of all functors/monads/categories

2010-06-27 Thread Max Bolingbroke
On 27 June 2010 13:16, Sjoerd Visscher sjo...@w3future.com wrote: Allowing Functor i also makes defining Thingy directly (without going though Monoidal) easy: newtype Thingy i a = Thingy { runThingy :: forall b. i (a - b) - i b } Great stuff! I particularly like your * definition, because it

Re: [Haskell-cafe] The mother of all functors/monads/categories

2010-06-27 Thread Max Bolingbroke
On 27 June 2010 18:28, Max Bolingbroke batterseapo...@hotmail.com wrote: I'm going to try automatically deriving a NBE algorithm for Moggi's monadic metalanguage from the Codensity monad - with luck it will correspond to the one-pass algorithm of Danvy. Well, that works. On second thoughts

Re: [Haskell-cafe] The mother of all functors/monads/categories

2010-06-27 Thread Max Bolingbroke
On 27 June 2010 19:14, Max Bolingbroke batterseapo...@hotmail.com wrote: I'm going to try for normalisation of Lindleys idiom calculus now. Made me sweat, but I got it to work. From Thingy you get a free one-pass normaliser for idioms. Is this a novel result? It's certainly very cool! Term

Re: [Haskell-cafe] Re: The mother of all functors/monads/categories

2010-06-27 Thread Max Bolingbroke
On 27 June 2010 22:20, Edward Kmett ekm...@gmail.com wrote: I've pointed out the Codensity Set monad on the Haskell channel. I spend no time on #haskell but clearly I should :) It is an interesting novelty, but it unfortunately has somewhat funny semantics in that the intermediate sets that

Re: [Haskell-cafe] Rank2Types and pattern matching

2010-07-04 Thread Max Bolingbroke
On 4 July 2010 00:24, Yves Parès limestr...@gmail.com wrote: then it works, so obviously, the trouble is about pattern matching. What was I doing wrong? This seems to be in violation of the Haskell Report. See e.g. section 3.3 (http://www.haskell.org/onlinereport/exps.html): The following

Re: [Haskell-cafe] Re: [Haskell] ANNOUNCE: jhc 0.7.4

2010-07-11 Thread Max Bolingbroke
On 11 July 2010 07:46, John Meacham j...@repetae.net wrote: On Sun, Jul 11, 2010 at 01:20:26AM -0500, Antoine Latter wrote: Now compiling with jhc I end up with: hs.out_code.c:85:2: error: #error Could not determine Byte Order Attached is a patch which fixes this for me, although I only have

Re: [Haskell-cafe] How do you make constant expressions?

2010-07-19 Thread Max Bolingbroke
Use NoMonomorphismRestriction or give an explicit type signature: width :: Num a = a width = 800 Max On 19 July 2010 09:17, Eitan Goldshtrom thesource...@gmail.com wrote: Correction to my last e-mail. I figured out why it worked at first and then failed, so I'll refine my question. I'd like

Re: [Haskell-cafe] hsb2hs preprocessor looking for a maintainer

2010-08-04 Thread Max Bolingbroke
On 4 August 2010 07:42, Joachim Breitner m...@joachim-breitner.de wrote: out of a discussion in haskell-devscripts, John MacFarlane wrote a very nice tool, called hsb2hs, that allows you to include any binary (or text) file as a constant in your program. When I've needed to do this in the

Re: [Haskell-cafe] hsb2hs preprocessor looking for a maintainer

2010-08-04 Thread Max Bolingbroke
On 4 August 2010 11:39, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Joachim Breitner m...@joachim-breitner.de writes: the problem is that Template Haskell does not work on all architectures, so the Debian people prefer solutions that avoid TH if it is not needed. Yeah, we've just

Re: [Haskell-cafe] hsb2hs preprocessor looking for a maintainer

2010-08-04 Thread Max Bolingbroke
On 4 August 2010 12:34, Thomas Schilling nomin...@googlemail.com wrote: I believe the main reason why ghci isn't available on all platforms is the dynamic linker.  I don't think it would be easy (or even feasible) to switch to something like 'ld', though. AFAIK the current linker is meant to

[Haskell-cafe] [GSoC] Plugins for GHC

2008-03-21 Thread Max Bolingbroke
Hi, I'm interested in working on a plugins system for the Glasgow Haskell Compiler. The idea here is to allow third parties to add more capabilities to the compiler in a way that doesn't involve messing around with modifying GHC itself. Potential use cases are: * Allow Haskell code to be

[Haskell-cafe] Re: [Haskell] ANN: Hayoo! beta 0.1

2008-04-06 Thread Max Bolingbroke
On 06/04/2008, Timo B. Hübel [EMAIL PROTECTED] wrote: Hello, we are pleased to announce the first beta release of Hayoo!, a Haskell API search engine providing advanced features like suggestions, find-as-you-type, fuzzy queries and much more. Very nice! I'm not sure if this is documented

Re: [Haskell-cafe] Re: GHC API GSoc project

2008-05-15 Thread Max Bolingbroke
My own priority is to have the compilation phases exposed. One (selfish) reason for this is that it will force a number of refactorings and cleanups inside GHC, that we've had on the radar for some time. As soon as there's a wiki page up I can start downloading some of the contents of my

Re: [Haskell-cafe] Profiling nested case

2008-07-11 Thread Max Bolingbroke
It is somehow award that passing function as an argument slow down the program so much. Is not Haskell a functional language and this such (functional) code reuse is one of its main points? I can think of a few reasons why function passing is slow: * There is an overhead to closure creation (I

[Haskell-cafe] Human-friendly compiler errors for GHC

2008-07-12 Thread Max Bolingbroke
I had some free time this afternoon so I put together an (experimental) patch for GHC that implements helpful errors messages. Have a look at this GHCi session to see what I mean: $ stage2/ghc-inplace --interactive -fhelpful-errors GHCi, version 6.9.20080711: http://www.haskell.org/ghc/ :? for

Re: [Haskell-cafe] Human-friendly compiler errors for GHC

2008-07-12 Thread Max Bolingbroke
Personally, I would suggest make it take up less space. A newline for each match may be alright if there are only 3 suggestions, but past that it begins to take up too much of the screen. Columns are nice, or perhaps a limit on how many matches will be displayed (with more available if the

Re: [Haskell-cafe] Human-friendly compiler errors for GHC

2008-07-12 Thread Max Bolingbroke
2008/7/12 Evan Laforge [EMAIL PROTECTED]: What do you think about this feature? Would it be genuinely helpful or annoying? It could be handy if it understands qualified names. Occasionally typos e.g. just now Confg.default_x are surprisingly hard to see and I go around making sure Config

Re: [Haskell-cafe] Human-friendly compiler errors for GHC

2008-07-12 Thread Max Bolingbroke
That's pretty cool. Unfortunately in my early Haskell days the 'not in scope' errors were the only ones I _did_ understand. Heh :-) It would be nice to human-friendlify the other types of errors. I'm not judging your work though, this is helpful, and the other types of errors are of

Re: [Haskell-cafe] Human-friendly compiler errors for GHC

2008-07-13 Thread Max Bolingbroke
2008/7/13 Isaac Dupree [EMAIL PROTECTED]: wren ng thornton wrote: In terms of making error messages more helpful, I don't find general typos are much of an issue, but this part would be really nice! I've always been annoyed that GHC just says no rather than offering suggestions (-v is rarely

Re: [Haskell-cafe] Human-friendly compiler errors for GHC

2008-07-13 Thread Max Bolingbroke
2008/7/13 Claus Reinke [EMAIL PROTECTED]: That is the approach the haskellmode plugins for Vim take: build an index of Haddocumented identifiers once per installation, build an index of import-available identifiers once per :make. The latter turns out to be a performance issue for large

Re: [Haskell-cafe] Mutually recursive modules and google protocol-buffers

2008-07-15 Thread Max Bolingbroke
And there is no way ghc can compile these in separate modules. I may be being redundant here, but you may not know that GHC actually can compile mutually recursive modules. See http://www.haskell.org/ghc/docs/latest/html/users_guide/separate-compilation.html#mutual-recursion . Of course, this is

Re: [Haskell-cafe] Profiling nested case

2008-07-18 Thread Max Bolingbroke
2008/7/18 Mitar [EMAIL PROTECTED]: On Sat, Jul 12, 2008 at 3:33 AM, Max Bolingbroke [EMAIL PROTECTED] wrote: If findColor had been a function defined in terms of foldr rather than using explicit recursion, then theres a good chance GHC 6.9 would have fused it with the list to yield your

Re: [Haskell-cafe] Fwd: Uniplate + strict fields = fail. Why?

2009-10-01 Thread Max Bolingbroke
2009/10/1 Dmitry Astapov dasta...@gmail.com: Hi, I've been playing with generics in general (pardon the pun) and Uniplate in particular, and found out that strict data fields somehow derail Uniplate. I think this is related to Neil's bug report about Ratio:

Re: [Haskell-cafe] GHC core packages: same core?

2009-10-13 Thread Max Bolingbroke
Hi Dimitry, ghc-core is a pretty-printer for GHC's internal Core language (you can get a non-pretty-printed version simply by compiling with (IIRC) -dverbose-core2core). This is what we actually optimize and generate code from, and the formatting of this output might change at any time. This is

Re: [Haskell-cafe] a library for control of terminal driver modes?

2009-10-13 Thread Max Bolingbroke
Yes, ansi-terminal supports this. Try: setSGR [SetBlinkSpeed NoBlink] (http://hackage.haskell.org/packages/archive/ansi-terminal/0.5.0/doc/html/System-Console-ANSI.html) Cheers, Max 2009/10/12 Iain Barnett iainsp...@gmail.com: On 11 Oct 2009, at 15:30, Andrew Coppin wrote: Iain Barnett

Re: [Haskell-cafe] a library for control of terminal driver modes?

2009-10-13 Thread Max Bolingbroke
Err, I managed to completely misread your email. Sorry. Unfortunately, ansi-terminal does NOT support disabling the echo and I don't plan to support it. However, given that I already provide non-ANSI features from it, patches would be happily accepted :-) Cheers, Max 2009/10/13 Max Bolingbroke

Re: [Haskell-cafe] GHC core packages: same core?

2009-10-14 Thread Max Bolingbroke
to match the spec in http://www.haskell.org/ghc/docs/6.10.4/html/ext-core/core.pdf and the core itself can be produced with -fext-core, correct? I think it might be interesting for people working on alternative backends (inlcuding myself). On Tue, Oct 13, 2009 at 4:53 PM, Max Bolingbroke

Re: [Haskell-cafe] Implicit newtype unwrapping

2009-12-02 Thread Max Bolingbroke
2009/12/3 Gregory Crosswhite gcr...@phys.washington.edu: But it seems to me like the whole point of using newtype is because you *don't* want your new type to be used everywhere that the old type can be used;  otherwise you would just use type to create an alias.  The only convincing

Re: [Haskell-cafe] GHC 6.12 status and features

2009-12-12 Thread Max Bolingbroke
2009/12/12 Rafael Gustavo da Cunha Pereira Pinto rafaelgcpp.li...@gmail.com: I know I should probably be asking to the GHC list, but is there any update on 6.12 since October? Any probable release date? It looks like haskell.org just acquired this page, though it's not yet linked to from

Re: [Haskell-cafe] OT: Literature on translation of lambda calculus to combinators

2010-01-28 Thread Max Bolingbroke
See, for example, slide 119 and onwards in the slides at http://www.cl.cam.ac.uk/teaching/0809/FFuncProg/FoFP_2009_slides.pdf The slides covers SKI and BCSKI. Cheers, Max 2010/1/28 Dušan Kolář ko...@fit.vutbr.cz: Dear cafe,  Could anyone provide a link to some paper/book (electronic version

Re: [Haskell-cafe] Anyone up for Google SoC 2010?

2010-02-02 Thread Max Bolingbroke
2010/1/31 Malcolm Wallace malcolm.wall...@cs.york.ac.uk: Both of these roles are called mentor in the Google system.  Putting together a good team of mentors before applying as an organisation is helpful towards us being accepted into the programme. Having experienced being a student on the

Re: [Haskell-cafe] various dependencies breakages

2010-02-09 Thread Max Bolingbroke
Cabal can handle multiple versions of libraries, but you need to find a consistent set of libraries when building any one executable, since they are all going to be linked together. In this case Cabal has apparently failed to find such a set. You might be able to get this to work with cabal

Re: [Haskell-cafe] GHC RTS question

2010-02-21 Thread Max Bolingbroke
On 21 February 2010 18:58, Artyom Kazak artyom.ka...@gmail.com wrote: So, if I type ./prog +RTS --RTS +RTS, the output will be +RTS. But I want the output to be equal to the input IN ALL CASES, without any quotes, additional options, etc. I want all the command line to go to my program. How

Re: [Haskell-cafe] How do you rewrite your code?

2010-03-03 Thread Max Bolingbroke
Something I've been doing a lot lately is selective defunctionalisation, transformation into continuation passing style, and the combination of both things (CPS followed by defunctionalising the continuations). This is probably because I'm playing around with lambda calculus evaluators a lot

Re: [Haskell-cafe] real-time audio processing [Was: can Haskell do everyting as we want?]

2010-08-05 Thread Max Bolingbroke
On 5 August 2010 15:41, Job Vranish job.vran...@gmail.com wrote: John Van Enk and I are actually working on a language that's similar to C (and compiles to C), but has polymorphism, type inference and other goodies. I guess you have seen BitC (http://www.bitc-lang.org/)? It has the performance

Re: [Haskell-cafe] hsb2hs preprocessor looking for a maintainer

2010-08-05 Thread Max Bolingbroke
Hi Sergei On 5 August 2010 18:23, Sergei Trofimovich sly...@gmail.com wrote: I like the way GHC abstracted from foreign function call interface via libffi. It works on everything where i tried GHC. Would be nice to have exactly the same thing for ELF(and more) loader. OK, I've put the text of

Re: [Haskell-cafe] ghc in macports

2010-08-12 Thread Max Bolingbroke
On 12 August 2010 12:17, Ozgur Akgun ozgurak...@gmail.com wrote: sounds good to me. where can I find the list of packages (or whatever they call them in homebrew, formula?) available? Homebrew only makes available GHC and the Platform:

Re: [Haskell-cafe] Is there a pure Haskell gzip/bzip compression module out there?

2010-08-12 Thread Max Bolingbroke
On 12 August 2010 12:10, C K Kashyap ckkash...@gmail.com wrote: I looked at Hackage and found a couple of pure Haskell modules for un-compression. Are there any for comression? I found Huffman compression - but what I need is something that I can uncompress with standard tools. The zlib

[Haskell-cafe] Lambda-case / lambda-if

2010-10-02 Thread Max Bolingbroke
Hi Cafe, I implemented the proposed Haskell' feature lambda-case/lambda-if [1] during the Haskell Implementors Workshop yesterday for a bit of fun. The patches are online [2, 3]. The feature is demonstrated in this GHCi session: $ inplace/bin/ghc-stage2 --interactive -XLambdaCase GHCi, version

[Haskell-cafe] Re: Lambda-case / lambda-if

2010-10-02 Thread Max Bolingbroke
Thanks to everyone who replied - it looks like this feature is enough in demand that GHC HQ may want to accept it. I've created a ticket at http://hackage.haskell.org/trac/ghc/ticket/4359 On 2 October 2010 14:23, Max Bolingbroke batterseapo...@hotmail.com wrote: Hi Cafe, I implemented

Re: [Haskell-cafe] Lambda-case / lambda-if

2010-10-05 Thread Max Bolingbroke
On 5 October 2010 17:38, Henning Thielemann schlepp...@henning-thielemann.de wrote: Richard O'Keefe schrieb: I'd prefer to see something like       \ 1 - f       | 2 - g but I'm sure something could be worked out. In order to be consistent with current case, maybe in layout mode: \1 - f

Re: [Haskell-cafe] Lambda-case / lambda-if

2010-10-05 Thread Max Bolingbroke
On 4 October 2010 00:38, Conal Elliott co...@conal.net wrote: I like it! Are the other sections available as well, e.g.,     (if False then else Cafe) Haskell -- Cafe They are not, though this would certainly make sense for lambda-if. It's not so clear with lambda-case because of the issue

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

2010-10-08 Thread Max Bolingbroke
On 8 October 2010 10:54, Simon Marlow marlo...@gmail.com wrote: We could make GHC respect the report, but we'd have to use  (e op)  ==  let z = e in \x - z op x to retain sharing without relying on full laziness. This might be a good idea in fact - all other things being equal, having

Re: [Haskell-cafe] Finite but not fixed length...

2010-10-13 Thread Max Bolingbroke
On 13 October 2010 08:57, Jason Dusek jason.du...@gmail.com wrote:  Is there a way to write a Haskell data structure that is  necessarily only one or two or seventeen items long; but  that is nonetheless statically guaranteed to be of finite  length? Maybe you want a list whose denotation is

Re: [Haskell-cafe] Client-extensible heterogeneous types (Duck-typed variadic functions?)

2010-10-14 Thread Max Bolingbroke
On 14 October 2010 08:34, Jacek Generowicz jacek.generow...@cern.ch wrote: Those other data might be the functions' arguments, or they might be other functions with which they are to be combined, or both. You can represent these as existential packages. However, as Oleg shows you can always use

Re: [Haskell-cafe] Client-extensible heterogeneous types (Duck-typed variadic functions?)

2010-10-14 Thread Max Bolingbroke
On 14 October 2010 08:56, Max Bolingbroke batterseapo...@hotmail.com wrote: But if the only operation you ever do on this pair is (.), you may as well skolemise and just store (fnA1 . fnA2) directly. What is the advantage of doing otherwise? I forgot to mention that if you *really really* want

Re: [Haskell-cafe] Strict Core?

2010-10-16 Thread Max Bolingbroke
Hi Gregory, On 15 October 2010 22:27, Gregory Crosswhite gcr...@phys.washington.edu wrote: Out of curiosity, are there any plans for GHC to eventually use the Strict Core language described in http://www.cl.cam.ac.uk/~mb566/papers/tacc-hs09.pdf? I do not have plans to add it. I think it would

[Haskell-cafe] Eta-expansion and existentials (or: types destroy my laziness)

2010-10-16 Thread Max Bolingbroke
Hi Cafe, I've run across a problem with my use of existential data types, whereby programs using them are forced to become too strict, and I'm looking for possible solutions to the problem. I'm going to explain what I mean by using a literate Haskell program. First, the preliminaries: {-#

Re: [Haskell-cafe] Eta-expansion and existentials (or: types destroy my laziness)

2010-10-16 Thread Max Bolingbroke
On 16 October 2010 12:16, Roman Leshchinskiy r...@cse.unsw.edu.au wrote: eta :: Stream a - Stream a eta s = Stream s next   where     next (Stream s next') = case next' s of                               Just (x,s') - Just (x,Stream s' next')                               Nothing     -

[Haskell-cafe] Re: Eta-expansion and existentials (or: types destroy my laziness)

2010-10-19 Thread Max Bolingbroke
Hi Oleg, Thanks for your reply! Really? Here are two 'cons' that seem to satisfy all the criteria Thanks - your definitions are similar to Roman's suggestion. Unfortunately my criteria 3) is not quite what I actually wanted - I really wanted something GHC-optimisable - (so non-recursive

Re: [Haskell-cafe] Re: Eta-expansion and existentials (or: types destroy my laziness)

2010-10-22 Thread Max Bolingbroke
On 19 October 2010 19:01, Dan Doel dan.d...@gmail.com wrote: However, this argument is a bit circular, since that eliminator could be defined to behave similarly to an irrefutable match. Right. Or, put another way, eta expansion of a dictionary-holding existential would result in a value

[Haskell-cafe] Scrap your rolls/unrolls

2010-10-22 Thread Max Bolingbroke
Hi Cafe, In generic programming, e.g. as in Data Types a la Carte and Compos, you often wish to work with data types in their fix-point of a functor form. For example: data ListF a rec = Nil | Cons a rec newtype List a = Roll { unroll :: ListF a (List a) } In some presentations, this is done

Re: [Haskell-cafe] Re: Eta-expansion and existentials (or: types destroy my laziness)

2010-10-22 Thread Max Bolingbroke
On 22 October 2010 12:03, Dan Doel dan.d...@gmail.com wrote:  data Mu f = In { out :: f (Mu f) }  instance Show (f (Mu f)) = Show (Mu f) where    show = show . out Is that an example of a value recursive dictionary? Assuming the Show (f (Mu f)) instance uses the (Mu f) one, AFAIK this

[Haskell-cafe] Re: Scrap your rolls/unrolls

2010-10-22 Thread Max Bolingbroke
Forgot to reply to list On 22 October 2010 12:14, Dan Doel dan.d...@gmail.com wrote: Another solution, though, is SHE. With it, you can write:  data ListF a r = NilF | ConsF a r  newtype List a = Roll (ListF a (List a))  pattern Nil       = Roll NilF  pattern Cons x xs = Roll (ConsF x xs)

Re: [Haskell-cafe] Re: Scrap your rolls/unrolls

2010-10-22 Thread Max Bolingbroke
On 22 October 2010 22:06, Dan Doel dan.d...@gmail.com wrote: SHE's pattern synonyms also work as expressions, so there's no asymmetry. They work just like constructors as far as I can tell (with what little I've played with them); you can even partially apply them (in expressions). I didn't

Re: [Haskell-cafe] Scrap your rolls/unrolls

2010-10-23 Thread Max Bolingbroke
On 23 October 2010 15:32, Sjoerd Visscher sjo...@w3future.com wrote: A little prettier (the cata detour wasn't needed after all):   data IdThunk a   type instance Force (IdThunk a) = a Yes, this IdThunk is key - in my own implementation I called this Forced, so: type instance Force (Forced

Re: [Haskell-cafe] Is let special?

2010-11-02 Thread Max Bolingbroke
2010/11/2 Günther Schmidt gue.schm...@web.de: I've been given a few hints over time when I asked question concerning DSLs but regretfully didn't follow them up. I think this is probably to do with observable sharing. The problem in DSLs is if you have: fact :: Term - Term fact = Factorial

Re: [Haskell-cafe] Scrap your rolls/unrolls

2010-11-03 Thread Max Bolingbroke
On 2 November 2010 14:10, Bertram Felgenhauer bertram.felgenha...@googlemail.com wrote: Indeed. I had a lot of fun with the ideas of this thread, extending the 'Force' type family (which I call 'Eval' below) to a small EDSL on the type level: I also came up with this.. I was trying to use it

Re: [Haskell-cafe] Combining wl-pprint and ByteString?

2010-11-09 Thread Max Bolingbroke
On 9 November 2010 08:01, Mark Spezzano mark.spezz...@chariot.net.au wrote: I want to be able to run it from the command line in a terminal window, and have the text come up in colours (but very fast). My current version is already very fast, but I've heard everyone raving about how slow

Re: [Haskell-cafe] Fwd: Questions about lambda calculus

2010-11-10 Thread Max Bolingbroke
On 10 November 2010 12:49, Patrick LeBoutillier patrick.leboutill...@gmail.com wrote: I'm a total newbie with respect to the lambda calculus. I tried (naively) to port these examples to Haskell to play a bit with them: [snip] You can give type signatures to your first definitions like this:

Re: [Haskell-cafe] Contexts for type family instances

2010-12-12 Thread Max Bolingbroke
On 12 December 2010 12:26, Stephen Tetley stephen.tet...@gmail.com wrote: type instance (DUnit a ~ DUnit b) = DUnit (a,b)           = DUnit a Requires UndecidableInstances but should work: {-# LANGUAGE TypeFamilies #-} type family DUnit a :: * data Point u = P2 u u type instance DUnit (Point

Re: [Haskell-cafe] Functor = Applicative = Monad

2010-12-15 Thread Max Bolingbroke
3, John Smith volderm...@hotmail.com wrote: I would like to formally propose that Monad become a subclass of Applicative I'm not in favour of this change because of the code breakage issue. However, I think that an acceptable plan (mentioned elsewhere on the list, but doesn't seem to have had

Re: [Haskell-cafe] OT: Monad co-tutorial: the Compilation Monad

2010-12-16 Thread Max Bolingbroke
On 17 December 2010 00:59, Gregg Reynolds d...@mobileink.com wrote: My real goal is to think about better language for software build systems, since what we have now is pretty weak, in my view. I can't speak for your monad based approach, but you may be interested in Neil Mitchell's Haskell

Re: [Haskell-cafe] OT: Monad co-tutorial: the Compilation Monad

2010-12-18 Thread Max Bolingbroke
On 17 December 2010 12:45, Larry Evans cppljev...@suddenlink.net wrote: Am I doing something wrong or has somehow community.haskell.org been hijacked somehow? Er, it works for me. Maybe *your* DNS has been hijacked? I know lots of Windows viruses play tricks like this... Max

Re: [Haskell-cafe] UTF-8 in Haskell.

2010-12-23 Thread Max Bolingbroke
On 23 December 2010 05:29, Magicloud Magiclouds magicloud.magiclo...@gmail.com wrote:  If so, OK, then I think I could make a packInt which turns an Int into 4 Word8 first. Thus under all situation (ascii, UTF-8, or even UTF-32), my program always send 4 bytes through the network. Is that OK?

Re: [Haskell-cafe] Lazy cons, Stream-Fusion style?

2011-01-03 Thread Max Bolingbroke
Hi Stephen, On 2 January 2011 13:35, Stephen Tetley stephen.tet...@gmail.com wrote: Can a lazy cons be implemented for (infinite) Streams in the Stream-Fusion style? I made a mailing list post about almost exactly this issue a while ago

Re: [Haskell-cafe] Building lambdabot

2011-01-06 Thread Max Bolingbroke
On 6 January 2011 07:27, Joe Bruce bruce.jo...@gmail.com wrote: Now I'm stuck on readline again [lambdabot build step 28 of 81]: /Users/joe/.cabal/lib/readline-1.0.1.0/ghc-6.12.3/HSreadline-1.0.1.0.o: unknown symbol `_rl_basic_quote_characters' This seems to have been covered on Stack

Re: [Haskell-cafe] Building lambdabot

2011-01-06 Thread Max Bolingbroke
On 6 January 2011 16:11, Joe Bruce bruce.jo...@gmail.com wrote: Thanks, Max.  I had seen that thread already, but I don't understand how it helps me.  I'm on a x64 mac and I have both an i386 and x64 version of readline installed (via macports install readline +universal).  Perhaps cabal is

Re: [Haskell-cafe] Building lambdabot

2011-01-07 Thread Max Bolingbroke
On 7 January 2011 06:20, Joe Bruce bruce.jo...@gmail.com wrote: Thanks Max.  That makes a lot of sense.  That change got me to the point of linking lambdabot. Well, I tried to see if I could reproduce your problem but didn't get to this stage. It looks like v4.2.2.1 from Hackage hasn't been

Re: [Haskell-cafe] is datetime actively maintained?

2011-01-16 Thread Max Bolingbroke
Hi, I also wanted to build gitit on Windows and encountered the datetime issue. I sent the maintainer (Eric Sessoms) a request to bump his version bounds on the 22nd December, but haven't received a reply. (I had to bump a lot of other gitit version bounds, but those bumps *have* been taken

Re: [Haskell-cafe] Building lambdabot

2011-01-18 Thread Max Bolingbroke
On 18 January 2011 19:32, Joe Bruce bruce.jo...@gmail.com wrote: I did them both from scratch, just to make sure I understood what was going on and could communicate it for the next poor sap that is as ignorant as I was. Congratulations :-) Should/can I update the haskellwiki with this

Re: [Haskell-cafe] source line annotations

2011-01-19 Thread Max Bolingbroke
On 19 January 2011 22:43, Evan Laforge qdun...@gmail.com wrote:  Reasons why I don't actually want this after all? Are you aware of the magic assert function? http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Exception-Base.html#v:assert The compiler spots it and

Re: [Haskell-cafe] source line annotations

2011-01-20 Thread Max Bolingbroke
On 19 January 2011 23:59, Evan Laforge qdun...@gmail.com wrote: Another thing is that performance in logging is pretty critical.  When I profile, logging functions wind up in the expensive list if I'm not careful.  I don't know bad an unsafePerformIO plus a catch for every log msg is going to

  1   2   3   >