Re: [Haskell-cafe] Proposal: New syntax for Haskell

2013-09-10 Thread Edward Z. Yang
This is completely irrelevant, but the .chs extension is already taken by the c2hs tool. Cheers, Edward Excerpts from Niklas Hambüchen's message of Tue Sep 10 00:30:41 -0700 2013: Impressed by the productivity of my Ruby-writing friends, I have recently come across Cucumber: http://cukes.info

[Haskell-cafe] An Extra Empty Line

2013-09-09 Thread Hong Yang
Hi Dear Haskellers, I have this small program to grep recursively in parallel. It works fine, but generates the last line empty. Is this empty line coming from mapConcurrently()? Thanks, Hong -- mygrepr.hs -- lrf.pl is an old Perl script to get all non-duplicate files recursively under the

Re: [Haskell-cafe] starting GHC development -- two questions

2013-08-08 Thread Edward Z. Yang
Hello Ömer, First off, welcome to the wonderful world of GHC development! I recommend that you subscribe to the ghc-devs mailing list and direct GHC specific questions there: http://www.haskell.org/mailman/listinfo/ghc-devs While doing this, I think one feature would greatly help me

[Haskell-cafe] ANN: Monad.Reader Issue 22

2013-08-07 Thread Edward Z. Yang
I am pleased to announce that Issue 22 of the Monad Reader is now available. http://themonadreader.files.wordpress.com/2013/08/issue22.pdf Issue 22 consists of the following two articles: * Generalized Algebraic Data Types in Haskell by Anton Dergunov * Error Reporting Parsers: a Monad

Re: [Haskell-cafe] what is wrong w my IORef Word32 ?

2013-07-18 Thread Edward Z. Yang
shiftL has the wrong type: Bits a = a - Int - a so it is expecting the value in the IORef to be an Int. Edward Excerpts from Joerg Fritsch's message of Thu Jul 18 10:08:22 -0700 2013: All, what is wrong w the below code? I get an type error related to the operation shiftL import

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

2013-07-10 Thread Edward Z. Yang
In my opinion, when you are rebinding a variable with the same name, there is usually another way to structure your code which eliminates the variable. If you would like to write: let x = foo input in let x = bar x in let x = baz x in instead, write baz . bar . foo $ input If

Re: [Haskell-cafe] Lambda Calculus question on equivalence

2013-05-02 Thread Edward Z. Yang
The notion of equivalence you are talking about (normally L is referred to as a context) is 'extensional equality'; that is, functions f and g are equal if forall x, f x = g x. It's pretty easy to give a pair of functions which are not alpha equivalent but are observationally equivalent: if

Re: [Haskell-cafe] Lambda Calculus question on equivalence

2013-05-02 Thread Edward Z. Yang
Excerpts from Timon Gehr's message of Thu May 02 14:16:45 -0700 2013: Those are not lambda terms. Furthermore, if those terms are rewritten to operate on church numerals, they have the same unique normal form, namely λλλ 3 2 (3 2 1). The trick is to define the second one as x * 2 (and assume

Re: [Haskell-cafe] Looking for portable Haskell or Haskell like language

2013-04-27 Thread Hong Yang
I had similar work situation before. What I did was: install a CentOS virtual machine on Windows at home (CentOS version should be compatible to your RHEL5 version, and do not update it), then play with Haskell within CentOS. Your executables will be runnable on RHEL5. On Sat, Apr 27, 2013 at

Re: [Haskell-cafe] Stream fusion and span/break/group/init/tails

2013-04-22 Thread Edward Z. Yang
Z. Yang ezy...@mit.edu wrote: I've got a solution for this problem and it will form the basis of Repa 4, which I'm hoping to finish a paper about for the upcoming Haskell Symposium. Sounds great! You should forward me a preprint when you have something in presentable shape. I suppose

Re: [Haskell-cafe] conditional branching vs pattern matching: pwn3d by GHC

2013-04-22 Thread Edward Z. Yang
Note that, unfortunately, GHC's exhaustiveness checker is *not* good enough to figure out that your predicates are covering. :o) Perhaps there is an improvement to be had here. Edward Excerpts from Albert Y. C. Lai's message of Mon Apr 22 00:51:46 -0700 2013: When I was writing

[Haskell-cafe] Stream fusion and span/break/group/init/tails

2013-04-21 Thread Edward Z. Yang
Hello all, (cc'd stream fusion paper authors) I noticed that the current implementation of stream fusion does not support multiple-return stream combinators, e.g. break :: (a - Bool) - [a] - ([a], [a]). I thought a little bit about how might one go about implement this, but the problem seems

Re: [Haskell-cafe] Stream fusion and span/break/group/init/tails

2013-04-21 Thread Edward Z. Yang
I've got a solution for this problem and it will form the basis of Repa 4, which I'm hoping to finish a paper about for the upcoming Haskell Symposium. Sounds great! You should forward me a preprint when you have something in presentable shape. I suppose before then, I should look at

Re: [Haskell-cafe] Resource Limits for Haskell

2013-04-01 Thread Edward Z. Yang
I now have a paper draft describing the system in more detail. It also comes with a brief explanation of how GHC's profiling works, which should also be helpful for people who haven't read the original profiling paper. http://ezyang.com/papers/ezyang13-rlimits.pdf Edward Excerpts from

[Haskell-cafe] Monad.Reader #22 call for copy

2013-03-29 Thread Edward Z. Yang
Call for Copy: The Monad.Reader - Issue 22 Another ICFP submission deadline has come and gone: why not celebrate by submitting something to The Monad.Reader? Whether you're an established academic or have only just started learning Haskell, if you

Re: [Haskell-cafe] Future of MonadCatchIO

2013-03-26 Thread Edward Z. Yang
While block and unblock have been removed from base, they are still implementable in modern GHC. So another possible future is to deprecate MonadCatchIO (which should have been done a while ago, honestly!), but manually redefine the functions so that old code keeps working. Edward Excerpts

Re: [Haskell-cafe] MVar which can not be null ?

2013-03-18 Thread Edward Z. Yang
If you are doing IO operations, then the operation is hardly atomic, is it? Just take from the MVar, compute, and when you're done, put a value back on the MVar. So long as you can guarantee all users of the MVar take before putting, you will have the desired semantics. Something worth

[Haskell-cafe] ANN: Monad.Reader Issue 21

2013-03-16 Thread Edward Z. Yang
I am pleased to announce that Issue 21 of the Monad Reader is now available. http://themonadreader.files.wordpress.com/2013/03/issue21.pdf Issue 21 consists of the following two articles: * A Functional Approach to Neural Networks by Amy de Buitléir, Michael Russell, Mark Daly *

[Haskell-cafe] Resource Limits for Haskell

2013-03-15 Thread Edward Z. Yang
Hey folks, Have you ever wanted to implement this function in Haskell? -- | Forks a thread, but kills it if it has more than 'limit' -- bytes resident on the heap. forkIOWithSpaceLimit :: IO () - {- limit -} Int - IO ThreadId Well, now you can! I have a proposal and set of patches

Re: [Haskell-cafe] Resource Limits for Haskell

2013-03-15 Thread Edward Z. Yang
coverage at the moment is that there may be some primops that infinite loop, and there are probably other bugs, but I do not believe they are insurmountable. Edward Excerpts from Gwern Branwen's message of Fri Mar 15 14:39:50 -0700 2013: On Fri, Mar 15, 2013 at 5:17 PM, Edward Z. Yang ezy

Re: [Haskell-cafe] Open-source projects for beginning Haskell students?

2013-03-12 Thread Edward Z. Yang
I also support this suggestion. Although, do we have the build infrastructure for this?! Edward Excerpts from Michael Orlitzky's message of Mon Mar 11 19:52:12 -0700 2013: On 03/11/2013 11:48 AM, Brent Yorgey wrote: So I'd like to do it again this time around, and am looking for

Re: [Haskell-cafe] To seq or not to seq, that is the question

2013-03-09 Thread Edward Z. Yang
Excerpts from Tom Ellis's message of Sat Mar 09 00:34:41 -0800 2013: I've never looked at evaluate before but I've just found it's haddock and given it some thought. http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Exception-Base.html#v:evaluate Since it is

[Haskell-cafe] To seq or not to seq, that is the question

2013-03-08 Thread Edward Z. Yang
Are these equivalent? If not, under what circumstances are they not equivalent? When should you use each? evaluate a return b a `seq` return b return (a `seq` b) Furthermore, consider: - Does the answer change when a = b? In such a case, is 'return $! b' permissible? -

[Haskell-cafe] Ticking time bomb

2013-01-30 Thread Edward Z. Yang
https://status.heroku.com/incidents/489 Unsigned Hackage packages are a ticking time bomb. Cheers, Edward ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Ticking time bomb

2013-01-30 Thread Edward Z. Yang
As long as we upload packages via plain HTTP, signing won't help though. I don't think that's true? If the package is tampered with, then the signature will be invalid; if the signature is also forged, then the private key is compromised and we can blacklist it. We care only about integrity,

Re: [Haskell-cafe] Ticking time bomb

2013-01-30 Thread Edward Z. Yang
Excerpts from Joachim Breitner's message of Wed Jan 30 12:59:48 -0800 2013: another reason why Cabal is no package manager¹. Based on the linked post, it seems that you are arguing that cabal-install is not a package manager, and thus it is not necessary for it to duplicate the work that real

Re: [Haskell-cafe] Ticking time bomb

2013-01-30 Thread Edward Z. Yang
Excerpts from Ramana Kumar's message of Wed Jan 30 14:46:26 -0800 2013: This argument seems specious. Whether or not cabal-install is or not intended to be a package manager, users expect it to act like one (as users expect rubygems to be a package manager), and, at the end of the day,

Re: [Haskell-cafe] Ticking time bomb

2013-01-30 Thread Edward Z. Yang
Excerpts from Joachim Breitner's message of Wed Jan 30 14:57:28 -0800 2013: I’m not against cryptographically signed packages on hackage. In fact, I would whole-heatedly appreciate it, as it would make my work as a package maintainer easier. I was taking the opportunity to point out an

Re: [Haskell-cafe] Example programs with ample use of deepseq?

2013-01-07 Thread Edward Z. Yang
There are two senses in which deepseq can be overkill: 1. The structure was already strict, and deepseq just forces another no-op traversal of the entire structure. This hypothetically affects seq too, although seq is quite cheap so it's not a problem. 2. deepseq evaluates too much, when it was

[Haskell-cafe] Second Call for Copy: Monad.Reader #21

2012-12-13 Thread Edward Z. Yang
Second Call for Copy: The Monad.Reader - Issue 21 - Whether you're an established academic or have only just started learning Haskell, if you have something to say, please consider writing an article for The Monad.Reader! The submission deadline

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Edward Z. Yang
The monoid instance is necessary to ensure adherence to the monad laws. Cheers, Edward Excerpts from Petr P's message of Sat Dec 08 10:59:25 -0800 2012: The class is defined as class (Monoid w, Monad m) = MonadWriter w m | m - w where ... What is the reason for the Monoid constrait?

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Edward Z. Yang
Excerpts from Roman Cheplyaka's message of Sat Dec 08 14:00:52 -0800 2012: * Edward Z. Yang ezy...@mit.edu [2012-12-08 11:19:01-0800] The monoid instance is necessary to ensure adherence to the monad laws. This doesn't make any sense to me. Are you sure you're talking about the MonadWriter

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Edward Z. Yang
First of all, I don't see why two tells should be equivalent to one tell. Imagine a MonadWriter that additionally records the number of times 'tell' has been called. (You might argue that your last equation should be a MonadWriter class law, but that's a different story — we're talking about

Re: [Haskell-cafe] mtl: Why there is Monoid w constraint in the definition of class MonadWriter?

2012-12-08 Thread Edward Z. Yang
Excerpts from Holger Siegel's message of Sat Dec 08 15:27:38 -0800 2012: For deriving a monoid instance of w from monad (Writer w), you will need function execWriter:: Writer w a - w, but in case of a general instance of (MonadWriter w m) you would have to use function listen :: m a - m (a, w)

Re: [Haskell-cafe] Problem with benchmarking FFI calls with Criterion

2012-11-23 Thread Edward Z. Yang
Hello Janek, What happens if you do the benchmark without unsafePerformIO involved? Edward Excerpts from Janek S.'s message of Fri Nov 23 10:44:15 -0500 2012: I am using Criterion library to benchmark C code called via FFI bindings and I've ran into a problem that looks like a bug. The

Re: [Haskell-cafe] Problem with benchmarking FFI calls with Criterion

2012-11-23 Thread Edward Z. Yang
Running the sample code on GHC 7.4.2, I don't see the one fast, rest slow behavior. What version of GHC are you running? Edward Excerpts from Janek S.'s message of Fri Nov 23 13:42:03 -0500 2012: What happens if you do the benchmark without unsafePerformIO involved? I removed

[Haskell-cafe] Monad.Reader #21 call for copy

2012-10-20 Thread Edward Z. Yang
Call for Copy: The Monad.Reader - Issue 21 Whether you're an established academic or have only just started learning Haskell, if you have something to say, please consider writing an article for The Monad.Reader! The submission deadline for Issue 21

Re: [Haskell-cafe] Haskell with all the safeties off

2012-09-07 Thread Edward Z. Yang
Haskell already does this, to some extent, in the design of imprecise exceptions. But note that bottom *does* have well defined behavior, so these optimizations are not very desirable. Edward Excerpts from David Feuer's message of Thu Sep 06 19:35:43 -0400 2012: I have no plans to do such a

Re: [Haskell-cafe] Haskell with all the safeties off

2012-09-07 Thread Edward Z. Yang
Excerpts from David Feuer's message of Fri Sep 07 12:06:00 -0400 2012: They're not *usually* desirable, but when the code has been proven not to fall into bottom, there doesn't seem to be much point in ensuring that things will work right if it does. This sort of thing only really makes sense

Re: [Haskell-cafe] Combining State and List Monads

2012-08-25 Thread Edward Z. Yang
Ah, egg in my face, I appear to have misremembered how ListT is implemented ^_^ http://www.haskell.org/haskellwiki/ListT_done_right may be relevant. Edward Excerpts from Edward Z. Yang's message of Sat Aug 25 01:51:40 -0400 2012: Hello Henry, In such cases, it is often worth thinking about

[Haskell-cafe] ANN: Monad.Reader Issue 20

2012-08-25 Thread Edward Z. Yang
*It’s not dead, it’s resting!* I am pleased to announce that Issue 20 of the Monad Reader is now available. http://themonadreader.files.wordpress.com/2012/08/issue20.pdf Issue 20 consists of the following three articles: - Enumeration of Tuples with Hyperplanes by Tillmann Vogt -

Re: [Haskell-cafe] Combining State and List Monads

2012-08-24 Thread Edward Z. Yang
Hello Henry, In such cases, it is often worth thinking about how you would implement such a scheme manually, without using pre-existing monads. You will quickly see that the two candidate types: s - ([a], s) [s - (a, s)] both will not work (exercise: what semantics do they give?) In

Re: [Haskell-cafe] mapping a concept to a type

2012-05-18 Thread Edward Z. Yang
I find both heavy and redundant. The first forces me to specify if I want an argument of not (with the constructors MR and NR) I'm sorry, I don't understand what you mean here. Do you know of a construction/abstraction that allows having or not an argument (a variable number of arguments,

Re: [Haskell-cafe] [Haskell-beginners] Is it only one data structure per ST monad?

2012-04-23 Thread Edward Z. Yang
If you mean, per 'ST s a', no: you can generate as many STRefs as you want. Edward Excerpts from KC's message of Mon Apr 23 14:32:57 -0400 2012: Is it only one data structure per ST monad? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Monad.Reader #20 - DEADLINE EXTENSION

2012-03-07 Thread Edward Z. Yang
Call for Copy: The Monad.Reader - Issue 20 - DEADLINE EXTENSION --- Whether you're an established academic or have only just started learning Haskell, if you have something to say, please consider writing an article for The Monad.Reader!

[Haskell-cafe] Second Monad.Reader #20 call for copy

2012-02-21 Thread Edward Z. Yang
Second Call for Copy: The Monad.Reader - Issue 20 - Whether you're an established academic or have only just started learning Haskell, if you have something to say, please consider writing an article for The Monad.Reader! The submission deadline

Re: [Haskell-cafe] Monad-control rant

2012-01-29 Thread Edward Z. Yang
Excerpts from Mikhail Vorozhtsov's message of Sun Jan 29 05:34:17 -0500 2012: You are trying to make bottoms a new null pointers. Sometimes it just doesn't worth the effort (or depends on the interpreter you use). I want to have the option to say: sorry, in this particular case (monad) I

Re: [Haskell-cafe] Terminology: different levels of strictness

2012-01-27 Thread Edward Z. Yang
There are some terms for these cases, but they are a bit ad hoc. length is what we might call spine-strict; head is head-strict. Projection analysis takes the approach that we can more precisely characterize the strictness only by considering both what is passed to the function as input, as well

Re: [Haskell-cafe] Monad-control rant

2012-01-24 Thread Edward Z. Yang
Excerpts from Mikhail Vorozhtsov's message of Tue Jan 24 07:26:35 -0500 2012: Sure, but note that evaluate for IO is implemented with seq# under the hood, so as long as you actually get ordering in your monad it's fairly straightforward to implement evaluate. (Remember that the ability

Re: [Haskell-cafe] Monad-control rant

2012-01-21 Thread Edward Z. Yang
Excerpts from Mikhail Vorozhtsov's message of Sat Jan 21 09:25:07 -0500 2012: But I also believe that you can't use this as justification to stick your head in the sand, and pretend bottoms don't exist (regardless of whether or not we'rd talking about asynchronous exceptions.) The reason is

Re: [Haskell-cafe] partial type annotations

2012-01-19 Thread Edward Z. Yang
Oleg has described a grody hack which achieves this effect. http://okmij.org/ftp/Haskell/types.html#partial-sigs I agree more first class support for this would be nice. Edward Excerpts from Nicholas Tung's message of Thu Jan 19 15:37:28 -0500 2012: Dear all, I wanted to voice

Re: [Haskell-cafe] Why were unfailable patterns removed and fail added to Monad?

2012-01-19 Thread Edward Z. Yang
Hello Gregory, The original (1998!) conversation can be found here: http://www.mail-archive.com/haskell@haskell.org/msg03002.html I think Simon Peyton-Jones' example really sums up the whole issue: But [MonadZero] really sticks in my craw. How can we explain this: f ::

Re: [Haskell-cafe] Why were unfailable patterns removed and fail added to Monad?

2012-01-19 Thread Edward Z. Yang
Oh, I'm sorry! On a closer reading of your message, you're asking not only asking why 'fail' was added to Monad, but why unfailable patterns were removed. Well, from the message linked: In Haskell 1.4 g would not be in MonadZero because (a,b) is unfailable (it can't fail to match). But

Re: [Haskell-cafe] Why were unfailable patterns removed and fail added to Monad?

2012-01-19 Thread Edward Z. Yang
Aw, that is really suboptimal. Have you filed a bug? Edward Excerpts from Michael Snoyman's message of Thu Jan 19 23:29:59 -0500 2012: On Fri, Jan 20, 2012 at 5:23 AM, Edward Z. Yang ezy...@mit.edu wrote: Oh, I'm sorry! On a closer reading of your message, you're asking not only asking why

Re: [Haskell-cafe] Why were unfailable patterns removed and fail added to Monad?

2012-01-19 Thread Edward Z. Yang
:41 AM, Edward Z. Yang ezy...@mit.edu wrote: Aw, that is really suboptimal.  Have you filed a bug? I think it's a feature, not a bug. When dealing with monads that provide nice[1] implementations of `fail`, you can (ab)use this to avoid writing a bunch of case expressions. I remember reading

[Haskell-cafe] Lifting IO (IO a) - IO a to m (m a) - m a with monad-control

2012-01-18 Thread Edward Z. Yang
Hello folks, I was curious whether or not it is possible to lift an arbitrary IO (IO a) - IO a function to MonadBaseControl IO m = m (m a) - m a. That is, implement a function: liftJoin :: MonadBaseControl mb m = (mb (mb (StM m a)) - mb (StM m a)) - m (m a) - m a The difficulty seems to be

Re: [Haskell-cafe] Monad-control rant

2012-01-18 Thread Edward Z. Yang
Excerpts from Mikhail Vorozhtsov's message of Wed Jan 18 08:47:37 -0500 2012: Well, that's the kind of language we live in. The denotation of our language always permits for bottom values, and it's not a terribly far jump from there to undefined and error foo. I don't consider the

[Haskell-cafe] REMINDER: Hac Boston from January 20-22 at MIT

2012-01-18 Thread Edward Z. Yang
I'd like to remind everyone that Hac Boston, a Haskell hackathon is being held January 20-22, 2012 at MIT (rooms 4-159 and 4-261) in Cambridge, MA. The hackathon will officially kick off at 2:30 Friday afternoon, and go until 5pm on Sunday with the occasional break for sleep. Everyone is welcome

Re: [Haskell-cafe] Monad-control rant

2012-01-16 Thread Edward Z. Yang
Hello Mikhail, Thanks for continuing to be willing to participate in a lively discussion. :-) Excerpts from Mikhail Vorozhtsov's message of Mon Jan 16 08:17:57 -0500 2012: On 01/16/2012 02:15 PM, Edward Z. Yang wrote: Anders and I thought a little more about your example, and we first wanted

Re: [Haskell-cafe] Monad-control rant

2012-01-15 Thread Edward Z. Yang
Hello Mikhail, Sorry, long email. tl;dr I think it makes more sense for throw/catch/mask to be bundled together, and it is the case that splitting these up doesn't address the original issue monad-control was designed to solve. ~ * ~ Anders and I thought a

Re: [Haskell-cafe] Monad-control rant

2012-01-10 Thread Edward Z. Yang
Excerpts from Mikhail Vorozhtsov's message of Tue Jan 10 09:54:38 -0500 2012: On 01/10/2012 12:17 AM, Edward Z. Yang wrote: Hello Mikhail, Hi. (Apologies for reviving a two month old thread). Have you put some thought into whether or not these extra classes generalize in a way

Re: [Haskell-cafe] Monad-control rant

2012-01-09 Thread Edward Z. Yang
Hello Mikhail, (Apologies for reviving a two month old thread). Have you put some thought into whether or not these extra classes generalize in a way that is not /quite/ as general as MonadBaseControl (so as to give you the power you need) but still allow you to implement the functionality you

[Haskell-cafe] Monad.Reader #20 call for copy

2012-01-04 Thread Edward Z. Yang
I'm pleased to announce that I, Edward Z. Yang, will be taking over Brent Yorgey's role as lead editor of the Monad Reader! Call for Copy: The Monad.Reader - Issue 20 Whether you're an established academic or have only just started learning Haskell

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

2011-12-29 Thread Edward Z. Yang
Here's an alternative perspective to consider: consider some data structure, such as a queue. There are two ways you can implement this, one the imperative way, with mutators, and the other the purely functional way, with no destructive updates. The question then, I ask, is how easy does a

Re: [Haskell-cafe] strict, lazy, non-strict, eager

2011-12-24 Thread Edward Z. Yang
1. a function f is strict if f ⊥ = ⊥ 2. ⊥ represents any computation which does not terminate, i.e. an exception or an infinite loop 3. strict describes the denotational semantics People, could you please make up your mind already? It has been more than 13 years. I have to admit, I'm a

Re: [Haskell-cafe] ANNOUNCE: hxournal-0.5.0.0 - A pen notetaking program written in haskell

2011-12-15 Thread Edward Z. Yang
When I attempt to build on Ubuntu, I get: ezyang@javelin:~$ cabal install hxournal Resolving dependencies... Configuring hxournal-0.5.0.0... Preprocessing library hxournal-0.5.0.0... In file included from /usr/include/gtk-2.0/gdk/gdkscreen.h:32:0, from

Re: [Haskell-cafe] ANNOUNCE: hxournal-0.5.0.0 - A pen notetaking program written in haskell

2011-12-12 Thread Edward Z. Yang
Very fancy! I am a big fan of Xournal, so I will have to take this for a spin. Edward Excerpts from Ian-Woo Kim's message of Mon Dec 12 06:56:09 -0500 2011: Hi, everyone, I am very pleased to announce a pen notetaking program: hxournal, which is written entirely in haskell using gtk2hs.

Re: [Haskell-cafe] Recommended class instances for container type

2011-12-08 Thread Edward Z. Yang
I'd hazard that if you went 'containers' and looked at what instances were implemented, that would give you a good idea. :^) (For example, if you look at Data.MAp, it has NFData, Typeable2 and Data instances.) Edward Excerpts from Christoph Breitkopf's message of Thu Dec 08 11:12:06 -0500 2011:

Re: [Haskell-cafe] Partial statical linking

2011-12-01 Thread Edward Z. Yang
libgmp and libffi are external libraries not associated with Haskell, so I don't think -static (which is for Haskell libraries) applies to them. You'll have the same problem with any other sort of library of this type, like libdl and friends ;-) Edward Excerpts from Jason Dusek's message of Sat

Re: [Haskell-cafe] Do type classes have a partial order?

2011-11-14 Thread Ling Yang
It seems like you would, going by semantics of System F, where types with type variables name a certain subset of types, = constraints further restrict the types of the same shape (are they an independent kind of restriction?), so typeclass declarations with/without = specify a partial order over

Re: [Haskell-cafe] SMP parallelism increasing GC time dramatically

2011-10-05 Thread Edward Z. Yang
Ketil, For your particular problem, unevaluated thunks should be easy to check: dump a heap profile and look for a decreasing allocation of thunks. That being said, IntMap is spine strict, so that will all be evaluated, and if your threads are accessing disjoint keys there should be no

Re: [Haskell-cafe] DSL for data definition (e.g. compiling Haskell type defs into Google's protocol buffers type defs)

2011-10-04 Thread Edward Z. Yang
Just making sure: have you looked at the Data.Data module yet? Edward Excerpts from Karel Gardas's message of Tue Oct 04 12:02:34 -0400 2011: Hello, I'm trying to find out if it's possible to use Haskell data type definition capability to define types and compile defined types into

Re: [Haskell-cafe] Is it possible to represent such polymorphism?

2011-10-02 Thread Edward Z. Yang
What are you actually trying to do? This seems like a rather unusual function. Edward Excerpts from sdiyazg's message of Sun Oct 02 15:17:07 -0400 2011: Finally I got what I meant: class ExpandTuple t where type Result t expand :: t-Result t instance (Integral a)=ExpandTuple

Re: [Haskell-cafe] how to read CPU time vs wall time report from GHC?

2011-08-14 Thread Edward Z. Yang
Hello Wishnu, That is slightly odd. What CPU and operating system are you running on? Include Kernel versions if Linux. Cheers, Edward Excerpts from Wishnu Prasetya's message of Sun Aug 14 14:11:36 -0400 2011: Hi guys, I'm new in parallel programming with Haskell. I made a simple test

Re: [Haskell-cafe] how to read CPU time vs wall time report from GHC?

2011-08-14 Thread Edward Z. Yang
Ah, good catch. :-) Edward Excerpts from Iustin Pop's message of Sun Aug 14 14:25:02 -0400 2011: On Sun, Aug 14, 2011 at 08:11:36PM +0200, Wishnu Prasetya wrote: Hi guys, I'm new in parallel programming with Haskell. I made a simple test program using that par combinator etc, and was a

[Haskell-cafe] Error in the asynchronous exception operational semantics

2011-08-09 Thread Edward Z. Yang
Hello all, I was recently reading Asynchronous Exceptions as an Effect by Harrison, Allwein, Gill and Procter, and noticed at the end that they found an error in the operational semantics described in Asynchronous Exceptions in Haskell by the Simons and Andrew Moran. Does anyone know what this

Re: [Haskell-cafe] How to ensure code executes in the context of a specific OS thread?

2011-07-04 Thread Edward Z. Yang
Sounds like something that could use a GHC Trac feature request. Edward ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] pool: Why doesn't it block?

2011-06-12 Thread Edward Z. Yang
The documentation seems to indicate that the behaviour should be blocking, so if it's not, might be a bug. withResource :: MonadCatchIO m = Pool a - (a - m b) - m b Temporarily take a resource from a Pool, perform an action with it, and return it to the pool afterwards. * If the

Re: [Haskell-cafe] pool: Why doesn't it block?

2011-06-12 Thread Edward Z. Yang
-Pool.html . My original intention of splitting pool off from persistent was so others could use it. If Bryan's maintaining resource-pool instead, I'd have no problem deprecating pool and using resource-pool in its place. Michael On Sun, Jun 12, 2011 at 12:06 PM, Edward Z. Yang ezy

Re: [Haskell-cafe] GHC7 build problem

2011-06-11 Thread Edward Z. Yang
Yes, the tree was broken for some time between yesterday and today, and you appear to have gotten unlikely. It should have been fixed now, so you should try again. Cheers, Edward Excerpts from Scott Lawrence's message of Sat Jun 11 12:44:18 -0400 2011: Trying to compile GHC7 from source (as

Re: [Haskell-cafe] GHC7 build problem

2011-06-11 Thread Edward Z. Yang
It appears the build is still broken. Sorry! Please stand by, or roll back the last set of commits. Edward Excerpts from Scott Lawrence's message of Sat Jun 11 12:44:18 -0400 2011: Trying to compile GHC7 from source (as the ubuntu repository is still on GHC6), I came across the following error

Re: [Haskell-cafe] How on Earth Do You Reason about Space?

2011-06-01 Thread Edward Z. Yang
That sounds like a plausible reason why naive copying explodes space. Something like string interning would be good here... and since you're hashing already... Edward Excerpts from Daniel Fischer's message of Wed Jun 01 06:46:24 -0400 2011: On Wednesday 01 June 2011 12:28:28, John Lato wrote:

Re: [Haskell-cafe] How on Earth Do You Reason about Space?

2011-05-31 Thread Edward Z. Yang
Hello Aleksandar, It is possible that the iteratees library is space leaking; I recall some recent discussion to this effect. Your example seems simple enough that you might recompile with a version of iteratees that has -auto-all enabled. Unfortunately, it's not really a safe bet to assume your

Re: [Haskell-cafe] Thoughts about currying and optimisations

2011-05-31 Thread Edward Z. Yang
I believe this transformation is called the 'full laziness' optimization. It can introduce space leaks if the computationally expensive test is replaced with a reference to a space expensive value. Edward Excerpts from Yves Parès's message of Tue May 31 15:14:07 -0400 2011: Hello Café, An idea

Re: [Haskell-cafe] runST readSTRef type error

2011-05-04 Thread Edward Z. Yang
Hello Ken, Strictly speaking, you only need Rank-2 types. This indeed the right way to fix the problem. Cheers, Edward Excerpts from Ken Takusagawa II's message of Wed May 04 02:00:49 -0400 2011: I run into the following type error: foo :: ST s (STRef s Int) - Int foo p = (runST (p =

Re: [Haskell-cafe] More ideas for controlled mutation

2011-04-30 Thread Edward Z. Yang
Excerpts from Heinrich Apfelmus's message of Mon Apr 25 04:01:03 -0400 2011: The thing is that lazy evaluation is referentially transparent while I don't care about [(1,4),(2,2)] vs [(2,2),(1,4)] is not. Perhaps more precisely, laziness's memoization properties rely on the referential

Re: [Haskell-cafe] GHC optimizer consuming memory

2011-04-30 Thread Edward Z. Yang
Hello Mike, I cannot reproduce using GHC HEAD (though it seems to hang on GHC 7.0.3), so my guess is the bug has been fixed. cvs-ghc, any guesses which patch this might have been? Cheers, Edward Excerpts from mike frai's message of Sat Apr 30 14:50:17 -0400 2011: Hi, While using Michael

Re: [Haskell-cafe] How to make ghc 7 with llvm?

2011-04-29 Thread Edward Z. Yang
Others have answered your real question (I think) adequately, but if I'm pedantic and answer precisely what you ask: You can compile GHC with llvm by adding -fllvm to your build.mk file: GhcHcOpts += -fllvm Cheers, Edward Excerpts from Magicloud Magiclouds's message of Thu Apr 28 21:49:11

[Haskell-cafe] More ideas for controlled mutation

2011-04-24 Thread Edward Z. Yang
Laziness can be viewed as a form of controlled mutation, where we overwrite a thunk with its actual value, thus only running the code once and reaping great time benefits. I've been toying around with some ideas where we do alternative forms of controlled mutation. One such idea has to do with

Re: [Haskell-cafe] generics and sql

2011-04-24 Thread Edward Z. Yang
Hmm, this is a bit peculiar. The problem is you don't get control over how gmapQ invokes the function toSql: it will only ever be done with the type signature Data d = d - u. There is good reason for this too: imagined you tried to run gmapQ toSql on a data-type that contained a member that was

Re: [Haskell-cafe] generics and sql

2011-04-24 Thread Edward Z. Yang
Where did 'query' come from? Edward ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] More ideas for controlled mutation

2011-04-24 Thread Edward Z. Yang
message of Sun Apr 24 17:41:23 -0400 2011: Edward Z. Yang ezy...@mit.edu writes: I've been toying around with some ideas where we do alternative forms of controlled mutation. One such idea has to do with memoization. [..] Hash tables take advantage of this fact by simply chaining together

Re: [Haskell-cafe] Killing threads in foreign calls.

2011-04-17 Thread Edward Z. Yang
This is a fairly nontrivial problem. First off, let me tell you what you do not /actually/ want to happen: you don't want the OS level thread performing the foreign call to actually be killed; most C code is not written a way that can gracefully recover from this, and unless you have explicit

Re: [Haskell-cafe] Debugging with gdb?

2011-04-13 Thread Edward Z. Yang
Hello Svante, I have a few recommendations, places where I'd check: 1. Consult the arguments passed to read() usign GDB (your libc has debugging symbols) and see if they are obviously wrong. It seems more plausible that they are something that would be right for Linux, but not so right

Re: [Haskell-cafe] Current heap size and other runtime statistics -- API for accessing in GHC?

2011-04-10 Thread Edward Z. Yang
Simon Marlow and I had this conversation not too long ago, and the answer is no. However, this is definitely something that would be useful for a lot of people (GHC developers included!) Cheers, Edward Excerpts from Ryan Newton's message of Sun Apr 10 17:30:50 -0400 2011: Hi cafe, The

Re: [Haskell-cafe] Deciding equality of functions.

2011-04-09 Thread Edward Z. Yang
Excerpts from Grigory Sarnitskiy's message of Sat Apr 09 13:26:28 -0400 2011: I guess that deciding whether two functions are equal in most cases is algorithmically impossible. However maybe there exists quite a large domain of decidable cases? If so, how can I employ that in Haskell? In the

Re: [Haskell-cafe] BlockedIndefinitelyOnMVar exception

2011-03-31 Thread Edward Z. Yang
I don't know if there's a way to disable it, but you can wrap all your spawned threads with an exception handler that catches BlockedIndefinitelyOnMVar and ignores it. If the thread blocks indefinitely, it's as good as dead, so there won't be any difference in behavior. Cheers, Edward

Re: [Haskell-cafe] How to best deal with nullPtr from alloca and friends?

2011-03-29 Thread Edward Z. Yang
Excerpts from Jason Dagit's message of Tue Mar 29 00:43:10 -0400 2011: I was reading up on the documentation for alloca and friends[1], which says, If any of the allocation functions fails, a value of

Re: [Haskell-cafe] ContT and ST stack

2011-03-11 Thread Edward Z. Yang
Excerpts from Max Bolingbroke's message of Fri Mar 11 05:15:34 -0500 2011: AFAIK this decision was reversed because SPJ found a simple way to support them. Indeed, they work fine in 7.0.2 and generate warnings. Correct. About a week-ish ago I submitted a patch to update the docs. Cheers,

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

2011-03-02 Thread Edward Z. Yang
The trick is to write the rank-2 type in the function that runs the monad, and leave the typeclasses skolemized. Here's an example: -- | Typeclass for monads that write or read to a network. Useful -- if you define operations that need to work for all such monads. -- You're expected to put

  1   2   3   >