Re: positive type-level naturals

2014-03-18 Thread wren ng thornton
On Sun, Mar 16, 2014 at 11:06 AM, Christiaan Baaij wrote: > Iavor is working on a branch that allows the constraint solver to call an > external solver: https://github.com/ghc/ghc/tree/decision-procedure > Currently, it: a) only supports CVC4 (an SMT solver), and b) is slightly out > of of line wi

Re: GHC 7.8 release?

2013-02-12 Thread wren ng thornton
On 2/12/13 3:37 AM, Simon Marlow wrote: One reason for the major version bumps is that base is a big conglomeration of modules, ranging from those that hardly ever change (Prelude) to those that change frequently (GHC.*). For example, the new IO manager that is about to get merged in will force a

Re: Newtype wrappers

2013-01-21 Thread wren ng thornton
On 1/21/13 1:40 AM, Shachaf Ben-Kiki wrote: For example: {-# LANGUAGE TypeFamilies #-} import Unsafe.Coerce newtype Id a = MkId { unId :: a } {-# RULES "fmap unId" fmap unId = unsafeCoerce #-} data family Foo x y a data instance Foo x y (Id a) = FooI x data

Re: Newtype wrappers

2013-01-20 Thread wren ng thornton
On 1/14/13 9:15 PM, Iavor Diatchki wrote: It looks like what we need is a different concept: one that talks about the equality of the representations of types, rather then equality of the types themselves. +1. In fact, this distinction is one of the crucial ones I had in mind when working on

Re: Newtype wrappers

2013-01-20 Thread wren ng thornton
On 1/14/13 2:47 PM, Stephen Paul Weber wrote: Somebody claiming to be Simon Peyton-Jones wrote: * For x1 we can write map MkAge x1 :: [Age]. But this does not follow the newtype cost model: there will be runtime overhead from executing the map at runtime, and sharing will be lost too. Could

Re: Newtype wrappers

2013-01-20 Thread wren ng thornton
On 1/14/13 1:09 PM, Simon Peyton-Jones wrote: Friends I'd like to propose a way to "promote" newtypes over their enclosing type. Here's the writeup http://hackage.haskell.org/trac/ghc/wiki/NewtypeWrappers Any comments? Below is the problem statement, taken from the above page. I'

Re: How to start with GHC development?

2012-12-14 Thread wren ng thornton
On 12/14/12 10:56 AM, Gershom Bazerman wrote: On 12/14/12 9:44 AM, Simon Peyton-Jones wrote: This thread has made it clear that we should do more to help people find a "way in" to GHC. Here is what I have done: ·Started a GHC Reading List page

building GHC for "antique" OSX

2012-12-09 Thread wren ng thornton
Hello all, I'm one of those curmudgeons still working on OSX 10.5.8. Recently I finally got around to building the latest GHC and, FWIW, everything seems to have worked out fine. I did get a few failed tests in the testsuite though, and I'm curious what they mean or if they're actually cause

Re: Generating random type-level naturals

2012-11-15 Thread wren ng thornton
On 11/5/12 6:23 PM, Eric M. Pashman wrote: I've been playing around with the idea of writing a genetic programming implementation based on the ideas behind HList. Using type-level programming, it's fairly straighforward to put together a program representation that's strongly typed, that suppo

Re: I/O overhead in opening and writing files

2012-08-27 Thread wren ng thornton
On 8/27/12 6:25 PM, J Baptist wrote: Using ByteStrings and the C calls does indeed speed things up a bit, but not much. real0m6.053suser0m1.480ssys 0m4.550s For your interest:The original version (with Strings and openFile): http://hpaste.org/73803Faster (with Strings and c_open):

Re: I/O overhead in opening and writing files

2012-08-27 Thread wren ng thornton
On 8/27/12 5:33 PM, Donn Cave wrote: It does, but it can also read directly to Ptr Word8 (fdReadBuf), which you'd think would be closer to hardware speed - but then you might lose the advantage trying to peek the data out of the buffer. In principle you ought to be able to stuff that pointer rig

Re: GHC build linking error

2012-06-11 Thread wren ng thornton
On 6/7/12 12:40 PM, Sean Leather wrote: I was hoping somebody else had a bright idea, but no takers, yet. I don't remember where I got my GMP.framework from, exactly. I thought it used to be bundled with the HP. But it's apparently not anymore. I did some digging and came across the old reposit

GHC build linking error

2012-06-04 Thread wren ng thornton
Hello all, I'm working on creating some distribution bundles of GHC 7.4.1 and HP 2012.2.0.0 for OSX 10.5 to help rectify the lack of support on older Macs. In building GHC I've run into a linking error in stage1: ld: duplicate symbol ___gmpz_abs in libraries/integer-gmp/gmp/objs/add.o an

Re: default instance for IsString

2012-04-24 Thread wren ng thornton
On 4/24/12 3:35 PM, Markus Läll wrote: For what I understand, and putting words in his mouth, he wants to write `"" :: XML' and have the compiler tell him at compile-time that this is not valid XML (if it actually is, imagine that there's something invalid between the double quotes). I.e he wants

Re: Stealing ideas from the latest GCC release

2012-03-23 Thread wren ng thornton
On 3/22/12 5:09 PM, Johan Tibell wrote: It'd be nice if we could get foo to specialize on its input arguments, without having to mark all of fooWith as INLINE. +1 million. I don't recall how many times I've wanted this optimization, even if it has to be specified manually. Unfortunately, I rec

Re: Why I Want Global Field Names (By Default)

2012-03-05 Thread wren ng thornton
On 3/5/12 12:03 AM, Gershom Bazerman wrote: So, suppose we have a locally declared fields solution (such as DORF). Now, where do these fields live? Arguably, we want a module per record. Rather, part of the point of all this is precisely that we *don't* want one module per record. That's the o

Re: Records in Haskell

2012-02-29 Thread wren ng thornton
On 2/29/12 10:51 PM, wren ng thornton wrote: On 2/28/12 3:57 AM, AntC wrote: wren ng thornton freegeek.org> writes: I'm not sure it's a good proposal, but it seems like the only way to handle this issue is to (1) introduce a new kind for semantically-oriented field names, Tha

Re: Records in Haskell

2012-02-29 Thread wren ng thornton
On 2/28/12 3:57 AM, AntC wrote: wren ng thornton freegeek.org> writes: I'm not sure it's a good proposal, but it seems like the only way to handle this issue is to (1) introduce a new kind for semantically-oriented field names, That's what SORF does: the String Kind an

Re: New STM?

2012-02-29 Thread wren ng thornton
On 2/28/12 5:14 AM, Simon Marlow wrote: On 17/02/2012 18:36, wren ng thornton wrote: Hello all, I had some patches committed to STM a while back[1], and for some reason I was expecting them in the new GHC release. Does STM only ship with the Platform? If not, then any idea when the next

Re: Records in Haskell

2012-02-26 Thread wren ng thornton
On 2/26/12 12:38 AM, Anthony Clayden wrote: Wren/all Please remember SPJ's request on the Records wiki to stick to the namespace issue. We're trying to make something better that H98's name clash. We are not trying to build some ideal polymorphic record system. I believe my concern is a namesp

Re: Records in Haskell

2012-02-25 Thread wren ng thornton
On 2/25/12 10:18 AM, Gábor Lehel wrote: On Sat, Feb 25, 2012 at 3:54 PM, Barney Hilken wrote: After more pondering, I finally think I understand what the DORFistas want. Here is an example: You want to define records which describe people, and include (among other things) a field called "nam

Re: Records in Haskell

2012-02-25 Thread wren ng thornton
On 2/24/12 5:40 PM, Johan Tibell wrote: I share Greg's concerns about polymorphic projections. For example, given a function sort :: Ord a => ... we don't allow any 'a' that happens to export a operator that's spelled<= to be passed to 'sort'. We have the user explicitly create an instanc

Re: Understanding the -A and the -H flags

2012-02-25 Thread wren ng thornton
On 2/25/12 11:51 AM, Johan Tibell wrote: Perhaps it would make sense to document the actual algorithm used to set -A given -H (with and without argument.) +1. I've always been a bit hazy on how the two are related. -- Live well, ~wren ___ Glasgow-ha

New STM?

2012-02-17 Thread wren ng thornton
Hello all, I had some patches committed to STM a while back[1], and for some reason I was expecting them in the new GHC release. Does STM only ship with the Platform? If not, then any idea when the next version of STM will be released? [1] http://hackage.haskell.org/trac/ghc/ticket/5104 htt

Re: Changes to Typeable

2012-02-11 Thread wren ng thornton
On 2/11/12 8:12 PM, John Meacham wrote: On Sat, Feb 11, 2012 at 5:05 PM, Roman Leshchinskiy wrote: IMO, polymorphic kinds are far too experimental at this stage to be used in such a fundamental library. I also fully agree with Ian's point about other implementations. Should there perhaps be

Re: Records in Haskell

2012-02-11 Thread wren ng thornton
On 2/11/12 9:47 AM, Greg Weber wrote: What is the use case for changing the type of a record field on update? I use it all the time. One may just as well ask: What is the use case for changing the type of a Maybe on update? Or what is the use case for changing only one of the types for a tupl

Re: ANNOUNCE: GHC 7.4.1 Release Candidate 2

2012-01-28 Thread wren ng thornton
On 1/28/12 6:09 PM, Austin Seipp wrote: I presume the people in our boat are actually pretty small in number (OS X users are fairly keen to upgrade pretty quickly,) but it would be nice to not have to build it ourselves if that's the case. On the whole, we are. But there are some in worse posit

Re: Holes in GHC

2012-01-26 Thread wren ng thornton
On 1/26/12 1:30 PM, Dan Doel wrote: On Thu, Jan 26, 2012 at 12:45 PM, Thijs Alkemade wrote: Let me try to describe the goal better. The intended users are people new to Haskell or people working with existing code they are not familiar with. Also me. I want this feature. It pretty much singl

Re: Is it true that an exception is always terminates the thread?

2012-01-26 Thread wren ng thornton
On 1/26/12 10:01 PM, wren ng thornton wrote: On 1/24/12 10:25 AM, Ryan Newton wrote: This is related but somewhat tangential -- *Why isn't there a tryReadChan?* It looks like it would be implementable with the current Chan representation in terms of tryTakeMVar. Especially since isEmptyCh

Re: Is it true that an exception is always terminates the thread?

2012-01-26 Thread wren ng thornton
On 1/24/12 10:25 AM, Ryan Newton wrote: This is related but somewhat tangential -- *Why isn't there a tryReadChan?* It looks like it would be implementable with the current Chan representation in terms of tryTakeMVar. Especially since isEmptyChan is deprecated this would be nice to have.

Re: Is it true that an exception is always terminates the thread?

2012-01-26 Thread wren ng thornton
On 1/23/12 3:19 PM, Edward Z. Yang wrote: Excerpts from Heka Treep's message of Mon Jan 23 15:11:51 -0500 2012: actor mbox = do empty<- atomically $ isEmptyTChan mbox if empty then actor mbox else do val<- atomically $ readTChan mbox Uh, don't you want to combine isEmpty

Re: Unexpected list non-fusion

2012-01-15 Thread wren ng thornton
On 1/15/12 10:02 AM, Jan-Willem Maessen wrote: On Sat, Jan 14, 2012 at 10:48 PM, wren ng thornton wrote: On 12/12/11 3:37 PM, wren ng thornton wrote: I've noticed that take and filter are good producers (and consumers) for list fusion, but takeWhile, drop, and dropWhile are not. Is ther

Re: Unexpected list non-fusion

2012-01-14 Thread wren ng thornton
On 12/12/11 3:37 PM, wren ng thornton wrote: I've noticed that take and filter are good producers (and consumers) for list fusion, but takeWhile, drop, and dropWhile are not. Is there any reason for this discrepancy? If not, would I need to go through the libraries@ process for fixing i

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

2012-01-14 Thread wren ng thornton
On 1/13/12 11:31 PM, Chris Smith wrote: Anyone want to hazard a guess what percentage of Haskell programmers can even name every letter of the Greek alphabet? I'm betting less than 10%. That's easy for anyone with a classical education (or far too much mathematics education). There may well b

Re: Unit unboxed tuples

2012-01-10 Thread wren ng thornton
On 1/10/12 10:31 AM, Tyson Whitehead wrote: On January 8, 2012 23:49:47 wren ng thornton wrote: An alternative is to distinguish, say, (# x #) and its spaceful constructor (# #) from the spaceless (##); and analogously for the boxed tuples, though that introduces confusion about parentheses for

Re: Unit unboxed tuples

2012-01-10 Thread wren ng thornton
On 1/10/12 11:18 AM, Dan Doel wrote: On Tue, Jan 10, 2012 at 11:14 AM, Dan Doel wrote: On Tue, Jan 10, 2012 at 5:01 AM, Simon Marlow wrote: On 09/01/2012 04:46, wren ng thornton wrote: Shouldn't (# T #) be identical to T? No, because (# T #) is unlifted, whereas T is lifted

Re: Records in Haskell

2012-01-08 Thread wren ng thornton
On 12/30/11 10:58 PM, Matthew Farkas-Dyck wrote: On 30/12/2011, Andriy Polischuk wrote: Consider this example: quux (y . (foo>.< bar).baz (f . g)) moo It's not that easy to distinguish from quux (y . (foo>.< bar) . baz (f . g)) moo Yeah, that's why I dislike dot as compose operator (^_~)

Re: Records in Haskell

2012-01-08 Thread wren ng thornton
On 12/28/11 1:34 PM, Donn Cave wrote: Quoth Greg Weber, On Wed, Dec 28, 2011 at 2:12 PM, Donn Cave wrote: ... I would think row polymorphism is a must-have. Perhaps if you want *extensible* records. If you would like to make some progress with records in the near future rather than keeping

Re: ConstraintKinds and default associated empty constraints

2012-01-08 Thread wren ng thornton
On 1/8/12 8:32 AM, Bas van Dijk wrote: On 23 December 2011 17:44, Simon Peyton-Jones wrote: My attempt at forming a new understanding was driven by your example. class Functor f where type C f :: * -> Constraint type C f = () sorry -- that was simply type incorrect. () does not have

Re: Unit unboxed tuples

2012-01-08 Thread wren ng thornton
On 12/23/11 12:57 PM, Tyson Whitehead wrote: On December 23, 2011 09:37:04 Ganesh Sittampalam wrote: On 23/12/2011 13:46, Ian Lynagh wrote: On Fri, Dec 23, 2011 at 01:34:49PM +, Simon Peyton-Jones wrote: Arguments Boxed Unboxed 3 ( , , )(# , , #) 2 ( , )

Re: Unit unboxed tuples

2012-01-08 Thread wren ng thornton
On 12/23/11 8:34 AM, Simon Peyton-Jones wrote: More uniform! If you the singleton-unboxed-tuple data constructor in source code, as a function, you'd write (\x -> (# x #)). In a pattern, or applied, you'd write (# x #). Shouldn't (# T #) be identical to T? I know that a putative (T) woul

Re: 7.4.1-pre: Show & Integral

2012-01-08 Thread wren ng thornton
On 12/22/11 2:28 PM, J. Garrett Morris wrote: 2011/12/22 Edward Kmett: The change, however, was a deliberate _break_ with the standard that passed through the library review process a few months ago, and is now making its way out into the wild. Is it reasonable to enquire how many standard-com

Re: Unexpected list non-fusion

2011-12-19 Thread wren ng thornton
On 12/17/11 6:42 AM, Joachim Breitner wrote: Dear Wren, Am Donnerstag, den 15.12.2011, 17:38 + schrieb Simon Peyton-Jones: | Am Montag, den 12.12.2011, 15:37 -0500 schrieb wren ng thornton: |> I've noticed that take and filter are good producers (and consumers) |> for list

Re: Unexpected list non-fusion

2011-12-19 Thread wren ng thornton
On 12/15/11 12:38 PM, Simon Peyton-Jones wrote: | Am Montag, den 12.12.2011, 15:37 -0500 schrieb wren ng thornton: |> I've noticed that take and filter are good producers (and consumers) |> for list fusion, but takeWhile, drop, and dropWhile are not. Is there |> any r

Unexpected list non-fusion

2011-12-12 Thread wren ng thornton
I've noticed that take and filter are good producers (and consumers) for list fusion, but takeWhile, drop, and dropWhile are not. Is there any reason for this discrepancy? If not, would I need to go through the libraries@ process for fixing it, or should I just submit a patch? -- Live well,

Re: Revert a CAF?

2011-12-09 Thread wren ng thornton
On 12/7/11 5:03 AM, Simon Marlow wrote: It would be possible, but it's not quite as straightforward as you might think. Suppose you have a program like this: xs = [1..10] evens = filter ((==0) . (`mod` 2)) xs and you fully evaluate "evens". Now, GHC will garbage collect "xs", because it isn

Revert a CAF?

2011-12-06 Thread wren ng thornton
So, I have an optimization/internals question. Does the GHC API have any hooks for being able to revert a CAF to the original expression, thus discarding the previously computed result? The reason I'm wanting this is that I have a particular CAF which is an infinite list. Unfolding that list t

Re: Why not allow empty record updates?

2011-11-16 Thread wren ng thornton
On 11/15/11 8:07 PM, wagne...@seas.upenn.edu wrote: Quoting wren ng thornton : So far I've just defined helper functions to adjust the phantom type[1], each of which is implemented by (\x -> x { foo = foo x }). It's a horrible hack, but at least it's hidden away in library fu

Re: Why not allow empty record updates?

2011-11-15 Thread wren ng thornton
On 11/15/11 12:33 PM, Yitzchak Gale wrote: Simon Peyton-Jones wrote: Trouble is, what type does this have? f x = x {} Malcolm Wallace wrote: f :: a -> a Ian Lynagh wrote: That wouldn't help the original poster, as it is incompatible with f :: Foo Clean -> Foo Dirty Only because in t

Re: behaviour change in getDirectoryContents in GHC 7.2?

2011-11-08 Thread wren ng thornton
On 11/8/11 6:04 AM, Simon Marlow wrote: I really think we should provide the native APIs. The problem is that the System.Posix.Directory API is all in terms of FilePath (=String), and if we gave that a different meaning from the System.Directory FilePaths then confusion would ensue. So perhaps we

Re: Type error: Expected type: T. Actual type T ???

2011-10-29 Thread wren ng thornton
On 10/29/11 7:33 PM, Brandon Allbery wrote: On Sat, Oct 29, 2011 at 16:18, Bas van Dijk wrote: type Run t = ∀ n β. Monad n ⇒ t n β → n (St t β) foo :: (Monad m, MonadTransControl t) => (Run t -> m α) -> t m α foo f = liftControl f Type checking 'foo' this gives the following error: C

Re: Superclass defaults

2011-08-15 Thread wren ng thornton
On 8/15/11 7:44 AM, Conor McBride wrote: This is a recurring issue, at least as far as mailing list heat is concerned, but it would be good to have more evidence of substantial impact. The Monoid vs Semigroup issue is a case in point, perhaps. Folks, what do you think? For my work it'd certainl

Re: Superclass defaults

2011-08-15 Thread wren ng thornton
On 8/15/11 7:44 AM, Conor McBride wrote: On 15 Aug 2011, at 11:36, Simon Peyton-Jones wrote: But, concerning proposed extensions to GHC about class aliases/superclass defaults etc, the truth is that the biggest reason for inertia here at GHC HQ is not so much the implementation effort (athough t

Re: ghc cyclic import error confusing

2011-04-14 Thread wren ng thornton
On 4/14/11 1:24 PM, Bryan Richter wrote: Perhaps the following change would be sufficient? --- tmp/GhcMake.hs~ 2011-04-14 09:46:02.177298318 -0700 +++ tmp/GhcMake.hs 2011-04-14 09:52:25.121290827 -0700 @@ -1460,7 +1460,8 @@ cyclicModuleErr :: [ModSummary] -> SDoc cyclicModuleErr m

Re: ANNOUNCE: GHC version 7.0.3

2011-03-31 Thread wren ng thornton
On 3/31/11 4:30 AM, wren ng thornton wrote: On 3/30/11 4:44 AM, Simon Marlow wrote: On 30/03/2011 03:12, wren ng thornton wrote: FYI, testsuite results for OSX 10.5.8 32-bit build: 2695 total tests, which gave rise to 14978 test cases, of which 0 caused framework failures 12589 were skipped

Re: ANNOUNCE: GHC version 7.0.3

2011-03-31 Thread wren ng thornton
On 3/30/11 4:44 AM, Simon Marlow wrote: On 30/03/2011 03:12, wren ng thornton wrote: FYI, testsuite results for OSX 10.5.8 32-bit build: 2695 total tests, which gave rise to 14978 test cases, of which 0 caused framework failures 12589 were skipped 2302 expected passes 74 expected failures 0

Re: ANNOUNCE: GHC version 7.0.3

2011-03-29 Thread wren ng thornton
On 3/28/11 10:33 PM, Jens Petersen wrote: FYI testsuite results: [...] 8 unexpected failures on x86: DoParamM(normal) T3064(normal) T3330a(normal) T3738(normal) T4316(ghci) T4801(normal) break024(ghci) space_leak_001(normal) FYI, testsuite results for OSX 10.5.8

Re: GHC7 (on OSX.5)

2011-03-21 Thread wren ng thornton
On 3/21/11 4:16 AM, Christian Maeder wrote: Am 20.03.2011 20:01, schrieb wren ng thornton: So I'm having a go of installing ghc-7.0.2 and haskell-platform-2011.2.0.0 on OSX 10.5. Since 10.5 is no longer supported I've had to compile from source. The good news is, so far as

GHC7 (on OSX.5)

2011-03-20 Thread wren ng thornton
So I'm having a go of installing ghc-7.0.2 and haskell-platform-2011.2.0.0 on OSX 10.5. Since 10.5 is no longer supported I've had to compile from source. The good news is, so far as I can tell, everything works right out of the box.[1] But I've noticed when compiling the base libraries and HP

Re: RFC: migrating to git

2011-01-12 Thread wren ng thornton
On 1/12/11 5:34 PM, Tim Chevalier wrote: On Mon, Jan 10, 2011 at 8:52 AM, Malcolm Wallace wrote: If I were considering contributing minor patches to a project, the use of git would probably not deter me too much - I can cope with the simple stuff. But if I wanted more major involvement, git w

Re: Problems with openFd and -threaded

2010-11-30 Thread wren ng thornton
On 11/30/10 11:05 AM, Simon Marlow wrote: On 30/11/10 05:49, wren ng thornton wrote: I'll see if I can make a workaround with that, but as I said: Simon's already confirmed that this is a bug, I'm just looking for a ticket number or a version where it's fixed. And fix it I

Re: Problems with openFd and -threaded

2010-11-29 Thread wren ng thornton
On 11/29/10 6:36 PM, Bryan O'Sullivan wrote: On Sat, Nov 27, 2010 at 9:05 PM, wren ng thornton wrote: So I've just started playing around with STM and -threaded programs and I've run into a bug. The bug is similar to [1] except that the file in question is a Posix FIFO instead

Problems with openFd and -threaded

2010-11-27 Thread wren ng thornton
So I've just started playing around with STM and -threaded programs and I've run into a bug. The bug is similar to [1] except that the file in question is a Posix FIFO instead of a Bluetooth device. Same behavior: always errors with -threaded, but expected behavior when not -threaded (i.e., blo