Re: Avoiding BlockedIndefinitelyOnSTM exceptions

2014-07-20 Thread Gábor Lehel
On Sun, Jul 20, 2014 at 5:48 AM, wren romano winterkonin...@gmail.com wrote: On Sat, Jul 19, 2014 at 11:24 PM, wren romano winterkonin...@gmail.com wrote: -- | The second argument allows handling 'BlockedIndefinitelyOnSTM' etc. runSTSTM :: (forall s. STSTM s a) - (STMError - b) - b

Re: RFC: include a cabal-install executable in future GHC releases

2014-01-25 Thread Gábor Lehel
+1 to this proposal. The benefits are obvious and practical: when installing a new GHC, it will save users the tedium of having to figure out how to build a cabal-install and then do so before they can install the packages they actually want. The drawbacks are indefinite and amorphous: the

Re: Decomposition of given equalities

2013-12-30 Thread Gábor Lehel
- | From: Glasgow-haskell-users [mailto:glasgow-haskell-users- | boun...@haskell.org] On Behalf Of Gábor Lehel | Sent: 19 December 2013 16:12 | To: Richard Eisenberg | Cc: glasgow-haskell-users@haskell.org | Subject: Re: Decomposition of given equalities | | Does this boil down

Re: Excellent bikeshedding opportunity! Frontend syntax for pattern synonym types

2013-12-22 Thread Gábor Lehel
Other than being A. displayed in the Haddocks will this syntax also, now or at any later point, be B. explicitly written by the programmer alongside the definition of the pattern, or C. used as a type argument for other types? If it's only A and B, perhaps abominations like these could be

Re: Decomposition of given equalities

2013-12-19 Thread Gábor Lehel
to type-check the whole term unless I've made a mistake somewhere. I don't see an immediate way to fix the problem, but I haven't thought much about it. Does this help? Does anyone see a mistake in what I've done? Richard On Dec 18, 2013, at 6:38 PM, Gábor Lehel glaebho...@gmail.com

Decomposition of given equalities

2013-12-18 Thread Gábor Lehel
Hello, The upcoming GHC 7.8 recently gave me this error: Could not deduce (i ~ i1) from the context (f1 i ~ f i1) Which is strange to me: shouldn't (f1 i ~ f i1) exactly imply (f1 ~ f, i ~ i1)? (Or with nicer variable names: (f a ~ g b) = (f ~ g, a ~ b)?) When I inquired about this in

Re: Newtype wrappers

2013-01-22 Thread Gábor Lehel
On Tue, Jan 22, 2013 at 7:41 AM, wren ng thornton w...@freegeek.org wrote: 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 #-}

Re: Newtype wrappers

2013-01-15 Thread Gábor Lehel
On Tue, Jan 15, 2013 at 3:15 AM, Iavor Diatchki iavor.diatc...@gmail.com wrote: In general, I was never comfortable with GHC's choice to add an axiom equating a newtype and its representation type, because it looks unsound to me (without any type-functions or newtype deriving). For example,

Re: seemingly inconsistent behavior for kind-indexed type constraints in GHC 7.6

2012-10-06 Thread Gábor Lehel
further technical details about the context if there's interest. Thanks again! On Sat, Oct 6, 2012 at 7:30 AM, Gábor Lehel illiss...@gmail.com wrote: I made a version using an associated type and that seems to work fine: https://gist.github.com/3844758 (In fact you probably don't need a class

Re: PolyKind issue in GHC 7.6.1rc1: How to make a kind a functional dependency?

2012-09-18 Thread Gábor Lehel
On Sun, Sep 16, 2012 at 5:49 PM, Simon Peyton-Jones simo...@microsoft.com wrote: Fixing Any ~~~ * I think we can fix the Any problem readily by making Any into a type family, that has no instances. We certainly allow equalities with a type *family* application on the left and

Re: GADTs in the wild

2012-08-14 Thread Gábor Lehel
Lennart Augustsson has a really interesting example of using GADTs and the Maybe monad to validate an untyped AST into a typed, (mostly-)correct-by-construction AST here: http://augustss.blogspot.com/2009/06/more-llvm-recently-someone-asked-me-on.html This was one of my first exposures to GADTs

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

2012-07-13 Thread Gábor Lehel
On Thu, Jul 12, 2012 at 7:38 PM, Cale Gibbard cgibb...@gmail.com wrote: Personally I don't see why everyone appears to prefer the syntax with \ in it over just the obvious case section syntax which was originally proposed. case of { ... } looks much better to me than \case of { ... }

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

2012-07-05 Thread Gábor Lehel
On Thu, Jul 5, 2012 at 5:21 PM, Christopher Done chrisd...@gmail.com wrote: I like \case as is proposed. It seems the least controversial one and there's curry (\case ) for two-args, but even that seems a rare case. For what it's worth, I like the idea of omission being partiality, as in case

Re: default instance for IsString

2012-04-25 Thread Gábor Lehel
On Wed, Apr 25, 2012 at 11:39 AM, Ozgur Akgun ozgurak...@gmail.com wrote: One can always use a Maybe to make an IsString literal total. Perhaps this is what library authors should do in those cases when a fromString implementation is obviously partial. i.e. instead of instance IsString XML

Re: Records in Haskell

2012-03-01 Thread Gábor Lehel
On Fri, Mar 2, 2012 at 1:06 AM, Ian Lynagh ig...@earth.li wrote: On Thu, Mar 01, 2012 at 11:32:27PM +, AntC wrote: Yes-ish (leaving aside that issue). Under SORF you hve an extra behaviour: - use String Kinds and your label is public-everywhere and    completely uncontrollable. - (So

Re: Records in Haskell

2012-02-25 Thread Gábor Lehel
2012/2/25 Gábor Lehel illiss...@gmail.com: Please correct me if I've misunderstood or mischaracterized any aspect of DORF. Okay, I did end up misunderstanding and mischaracterizing at least two aspects of DORF. Re-reading the wiki page: http://hackage.haskell.org/trac/ghc/wiki/Records

Re: Records in Haskell

2012-02-25 Thread Gábor Lehel
On Sat, Feb 25, 2012 at 3:54 PM, Barney Hilken b.hil...@ntlworld.com 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 name. There might be

Re: Records in Haskell

2012-02-25 Thread Gábor Lehel
On Sat, Feb 25, 2012 at 10:09 PM, Isaac Dupree m...@isaac.cedarswampstudios.org wrote: On 02/25/2012 10:18 AM, Gábor Lehel wrote: This seems to me a much simpler approach than building the mechanism in to the language as DORF does, and it's also more general, because it isn't hard linked

Re: Records in Haskell

2012-02-24 Thread Gábor Lehel
On Fri, Feb 24, 2012 at 11:40 PM, Johan Tibell johan.tib...@gmail.com wrote: Hi Barney, On Fri, Feb 24, 2012 at 2:00 PM, Barney Hilken b.hil...@ntlworld.com wrote: Every one of your messages about records stresses your dislike for polymorphic projections, and your insistence that the Has

Re: Records in Haskell

2012-01-20 Thread Gábor Lehel
2012/1/18 Simon Peyton-Jones simo...@microsoft.com: | Has *is* a type class. It can be used and abused like any other. | Record members with the same key ought to have the same semantics; the | programmer must ensure this, not just call them all x or the like. | | Weak types these are

Re: Records in Haskell

2012-01-18 Thread Gábor Lehel
On Wed, Jan 18, 2012 at 1:09 PM, Matthew Farkas-Dyck strake...@gmail.com wrote: On 18/01/2012, Greg Weber g...@gregweber.info wrote: On Fri, Jan 13, 2012 at 8:52 PM, Simon Peyton-Jones simo...@microsoft.comwrote: But, the Has constraints MUST exist, in full glory, in the constraint solver.  

Re: Records in Haskell

2012-01-17 Thread Gábor Lehel
On Tue, Jan 17, 2012 at 9:59 AM, Yitzchak Gale g...@sefer.org wrote: By the way, thanks to Greg for driving this discussion, please keep up the good work! Simon Peyton-Jones wrote: Can you turn your proposal into a Wiki page? OK I'll try to get to that later today.  It's different to

Re: ConstraintKinds and default associated empty constraints

2012-01-09 Thread Gábor Lehel
On Mon, Jan 9, 2012 at 4:53 PM, Simon Peyton-Jones simo...@microsoft.com wrote: Three things about this ConstraintKinds thread: First, about  class Functor f where    type C f a :: Constraint    type C f a = () vs  class Functor f where    type C f :: * - Constraint    type C f = \_ - ()

Re: Records in Haskell

2012-01-08 Thread Gábor Lehel
2012/1/8 Greg Weber g...@gregweber.info: 2012/1/8 Gábor Lehel illiss...@gmail.com Thank you. I have a few questions/comments. The module/record ambiguity is dealt with in Frege by preferring modules and requiring a module prefix for the record if there is ambiguity. I think I see why

Re: Records in Haskell

2012-01-08 Thread Gábor Lehel
2012/1/8 Gábor Lehel illiss...@gmail.com: 2012/1/8 Greg Weber g...@gregweber.info: 2012/1/8 Gábor Lehel illiss...@gmail.com Thank you. I have a few questions/comments. The module/record ambiguity is dealt with in Frege by preferring modules and requiring a module prefix for the record

Re: Records in Haskell

2012-01-08 Thread Gábor Lehel
2012/1/8 Ingo Wechsung ingo.wechs...@googlemail.com: 2012/1/8 Gábor Lehel illiss...@gmail.com The second is that only the author of the datatype could put functions into its namespace; the 'data.foo' notation would only be available for functions written by the datatype's author, while

Re: Records in Haskell

2012-01-08 Thread Gábor Lehel
2012/1/8 Greg Weber g...@gregweber.info: 2012/1/8 Gábor Lehel illiss...@gmail.com Later on you write that the names of record fields are only accessible from the record's namespace and via record syntax, but not from the global scope. For Haskell I think it would make sense

Re: Records in Haskell

2012-01-07 Thread Gábor Lehel
2012/1/8 Gábor Lehel illiss...@gmail.com: Another thing that would be nice is lenses to solve the nested-record-update problem - at least the room to add them later. Most of the proposed syntax would be unaffected, but you'd need some syntax for the lens itself... I'm not sure what it might

Re: ConstraintKinds and default associated empty constraints

2011-12-22 Thread Gábor Lehel
On Thu, Dec 22, 2011 at 12:45 AM, Bas van Dijk v.dijk@gmail.com wrote: I'm playing a bit with the new ConstraintKinds feature in GHC 7.4.1-rc1. I'm trying to give the Functor class an associated constraint so that we can make Set an instance of Functor. The following code works but I

Re: Two Proposals

2011-10-11 Thread Gábor Lehel
On Sun, Oct 9, 2011 at 10:33 PM, George Giorgidze giorgi...@gmail.com wrote: Thanks to all of you for providing feedback on my proposal and for providing alternatives. In this email, I will try to collect all proposals and give pros and cons for each of those (although I will try to provide

Re: Two Proposals

2011-10-05 Thread Gábor Lehel
2011/10/5 Simon Peyton-Jones simo...@microsoft.com: |  In the spirit of don't let the perfect be the enemy of the good |  though, I'm solidly in favor of the original proposal as it is. This is my thought too.  George is proposing to extend Haskell's existing mechanism for numeric literals

Re: Two Proposals

2011-10-04 Thread Gábor Lehel
On Tue, Oct 4, 2011 at 3:25 PM, Yitzchak Gale g...@sefer.org wrote: George Giorgidze wrote: My second proposal is to introduce the OverloadedLists extension that overloads list literals... I am opposed to this proposal as stated. But I think that with a modification, it can not only be

Re: Two Proposals

2011-10-04 Thread Gábor Lehel
2011/10/4 Gábor Lehel illiss...@gmail.com: On Tue, Oct 4, 2011 at 3:25 PM, Yitzchak Gale g...@sefer.org wrote: George Giorgidze wrote: My second proposal is to introduce the OverloadedLists extension that overloads list literals... I am opposed to this proposal as stated. But I think

Re: Two Proposals

2011-10-04 Thread Gábor Lehel
On Fri, Sep 30, 2011 at 7:28 PM, George Giorgidze giorgi...@gmail.com wrote: GHC Users, I would like to make to the following two proposals:  * Eliminate the default grouping close from SQL-like comprehensions  * Introduce a GHC extension for list literal overloading OK, let me start with

Re: Superclass defaults

2011-08-15 Thread Gábor Lehel
On Mon, Aug 15, 2011 at 12:36 PM, Simon Peyton-Jones simo...@microsoft.com wrote: (Adding GHC users, and changing title.) | Conor McBride wrote: | http://hackage.haskell.org/trac/ghc/wiki/DefaultSuperclassInstances | I don't know if it's likely to be implemented in GHC anytime soon,.. |

Re: Superclass Cycle via Associated Type

2011-07-26 Thread Gábor Lehel
2011/7/25 Edward Kmett ekm...@gmail.com: 2011/7/25 Gábor Lehel illiss...@gmail.com type family Frozen t type family Thawed t class Immutable (Frozen t) = Mutable t where   thawedFrozen :: t - Thawed (Frozen t)   unthawedFrozen :: Thawed (Frozen t) - t class Mutable (Thawed t

Re: Superclass Cycle via Associated Type

2011-07-25 Thread Gábor Lehel
2011/7/23 Edward Kmett ekm...@gmail.com: 2011/7/23 Gábor Lehel illiss...@gmail.com 2011/7/22 Dan Doel dan.d...@gmail.com: 2011/7/22 Gábor Lehel illiss...@gmail.com: Yeah, this is pretty much what I ended up doing. As I said, I don't think I lose anything in expressiveness by going

Re: Superclass Cycle via Associated Type

2011-07-23 Thread Gábor Lehel
2011/7/22 Dan Doel dan.d...@gmail.com: 2011/7/22 Gábor Lehel illiss...@gmail.com: Yeah, this is pretty much what I ended up doing. As I said, I don't think I lose anything in expressiveness by going the MPTC route, I just think the two separate but linked classes way reads better. So it's

Re: Superclass Cycle via Associated Type

2011-07-22 Thread Gábor Lehel
On Thu, Jul 21, 2011 at 6:46 PM, Simon Peyton-Jones simo...@microsoft.com wrote: You point is that the (C Int) dictionary has (C String) as a superclass, and (C String) has (C Int) as a superclass. So the two instances are mutually recursive, but that’s ok. That is not unreasonable. But it

Re: Superclass Cycle via Associated Type

2011-07-22 Thread Gábor Lehel
2011/7/22 Simon Peyton-Jones simo...@microsoft.com: I talked to Dimitrios.  Fundamentally we think we should be able to handle recursive superclasses, albeit we have a bit more work to do on the type inference engine first. The situation we think we can handle ok is stuff like Edward wants

Re: Faster Array#/MutableArray# copies

2011-02-28 Thread Gábor Lehel
On Mon, Feb 28, 2011 at 6:29 PM, Johan Tibell johan.tib...@gmail.com wrote: On Mon, Feb 28, 2011 at 9:01 AM, Simon Marlow marlo...@gmail.com wrote: On 18/02/2011 19:42, Nathan Howell wrote: On Fri, Feb 18, 2011 at 12:54 AM, Roman Leshchinskiy r...@cse.unsw.edu.au mailto:r...@cse.unsw.edu.au

Re: RFC: migrating to git

2011-01-11 Thread Gábor Lehel
On Mon, Jan 10, 2011 at 12:19 PM, Simon Marlow marlo...@gmail.com wrote: It's time to consider again whether we should migrate GHC development from darcs to (probably) git. From our perspective at GHC HQ, the biggest problem that we would hope to solve by switching is that darcs makes