Re: [Haskell] Top Level -

2008-08-25 Thread Edward Kmett
On Sun, Aug 24, 2008 at 7:12 PM, Ashley Yakeley [EMAIL PROTECTED] wrote: Is there any interest in implementing a top level - to run monadic code? This is actually implemented in jhc. See the 'top level actions' section of http://repetae.net/computer/jhc/manual.html -Edward Kmett

Re: [Haskell] string type class

2009-03-06 Thread Edward Kmett
for things like lookup/insert functionality, so you can eliminate a major reason why Data.Map has to be imported qualified as well. -Edward Kmett On Fri, Mar 6, 2009 at 11:16 AM, minh thu not...@gmail.com wrote: 2009/3/6 Wolfgang Jeltsch g9ks1...@acme.softbase.org: Am Freitag, 6. März 2009 13:33

[Haskell] Re: [Haskell-cafe] ANNOUNCE: fad 1.0 -- Forward Automatic Differentiation library

2009-04-03 Thread Edward Kmett
more-limited-than-Num classes and only included the equivalent of your 'lift' and 'diffUU' operations, however. -Edward Kmett On Thu, Apr 2, 2009 at 10:28 PM, Bjorn Buckwalter bjorn.buckwal...@gmail.com wrote: I'm pleased to announce the initial release of the Haskell fad library, developed

[Haskell] Re: [Haskell-cafe] ANNOUNCE: fad 1.0 -- Forward Automatic Differentiation library

2009-04-03 Thread Edward Kmett
be somewhat more pedantic about the name. =) -Edward Kmett On Fri, Apr 3, 2009 at 10:49 AM, Barak A. Pearlmutter ba...@cs.nuim.iewrote: I feel silly, did not even notice that! Thanks for the pointer. Would be sensible to merge the functionalities; will try to import functionality

Re: [Haskell] deriving Show for GADT?

2009-04-14 Thread Edward Kmett
I seem to recall Matt Morrow having some code lying around for automatically generating such instances using haskell-src-exts. I wonder how hard it would be to adapt to Template Haskell. -Edward Kmett On Tue, Apr 14, 2009 at 2:03 AM, Ryan Ingram ryani.s...@gmail.com wrote: You might be able

Re: [Haskell] memory management

2009-08-06 Thread Edward Kmett
based memory management [ http://portal.acm.org/citation.cfm?id=993040 , pre-print: http://www.elsman.com/retro.pdf], which I think has the right balance of optimism and pragmatism where it comes to region-based memory management and talks about many of these issues. -Edward Kmett On Thu, Aug 6

Re: [Haskell] Re: [Haskell-cafe] Work on Video Games in Haskell

2010-05-26 Thread Edward Kmett
. -Edward Kmett ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell] ANNOUNCE: incremental-parser library package

2011-03-22 Thread Edward Kmett
2011/3/22 Mario Blažević mblaze...@stilo.com This seems very interesting. One question: The MonadPlus and the Alternative instance differ: the former's mplus combinator equals the asymmetric | choice. Why? Good question. Basically, I see MonadPlus as a union of Monad and

[Haskell] ANNNOUNCE: lens 3.7 released

2012-12-07 Thread Edward Kmett
Greetings! I am happy to announce the release of version 3.7 of the lens package, which provides Lenses, Folds, and Traversals for working with arbitrary data types. In its simplest form, a lens is a getter/setter pair, that can be composed and reasoned about with common sense laws that you can

Re: [Haskell] ANNNOUNCE: lens 3.7 released

2012-12-09 Thread Edward Kmett
On Sun, Dec 9, 2012 at 10:14 PM, Ashley Yakeley ash...@semantic.org wrote: On 07/12/12 02:19, Edward Kmett wrote: I am happy to announce the release of version 3.7 of the lens package, which provides Lenses, Folds, and Traversals for working with arbitrary data types. Do you use types

Re: [Haskell] Google Summer of Code | Haskell.org

2014-02-10 Thread Edward Kmett
That is the plan. We won't know officially until Google gets back to us about our org application in a couple of weeks. -Edward On Mon, Feb 10, 2014 at 8:08 AM, Narendra Joshi narendr...@gmail.comwrote: Hi there! Is haskell.org participating in this year's GSoC? -- narendra

[Haskell] CUFP 2014: Call for Presentations

2014-04-20 Thread Edward Kmett
. Program Committee = Edward Kmett (McGraw Hill Financial), co-chair Marius Eriksen (Twitter, Inc.), co-chair Ozgun Ataman (Soostone, Inc.) Tim Chevalier (AlephCloud) Derek Elkins (Now Business Intelligence) Matthew Might (University of Utah) Richard Minerich

[Haskell] [Haskell.org GSoC] Accepted Proposals

2014-04-21 Thread Edward Kmett
An Efficient Computational Algebra and Symbolic Linear Algebra Library in Haskell Hiromi ISHII Edward Kmett Complete plugins-ng low-level, filewatch, and cabal packages Kẏra Greg Weber Build Interactive Websites with GHCJS and Sodium Kyle Raftogianis Luite Stegeman Pandoc improvements: Embedded

Re: [Haskell] [Haskell.org GSoC] Accepted Proposals

2014-04-21 Thread Edward Kmett
2014 06:56, Edward Kmett ekm...@gmail.com wrote: I'm pleased to announce the list of accepted student proposals for haskell.org for the Google Summer of Code 2014. Title Student Mentor Adding profiling support to GHCJS -- JavaScript backend for GHC Ömer Sinan Aǧacan Luite Stegeman

[Haskell] Core libraries committee seeking self-nominations

2014-06-03 Thread Edward Kmett
participation in the GHC release process. Regards, Edward Kmett Haskell Core Libraries Committee Chair ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell

[Haskell] CUFP 2014: Call For Participation

2014-08-18 Thread Edward Kmett
Development without Frameworks (Part 2) Spiros Eliopoulos T5: Idris: Practical Software Verification with Dependent Types Edwin Brady T6: Lens Edward Kmett TUTORIALS, SEPTEMBER 5 == T7: Introduction to OCaml Leo White Jeremy Yallop T8: Programming in Rust Felix Klock Lars

[Haskell] [haskell.org Google Summer of Code] Call for Mentors

2015-04-06 Thread Edward Kmett
also have a #haskell-gsoc channel on irc.freenode.net if you have questions about what is involved. Thank you for your time and consideration, -Edward Kmett ___ Haskell mailing list Haskell@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo

[Haskell] Haskell Summer of Code

2016-02-29 Thread Edward Kmett
out the details. Please feel free to contact me if you think you can help or if you have any questions or concerns. -Edward Kmett ___ Haskell mailing list Haskell@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell

[Haskell] Summer of Haskell Mentors

2016-05-09 Thread Edward Kmett
If you are interesting in helping out as a possible mentor for this year's Summer of Haskell, please email me, and include MENTOR in the title. Thank you! -Edward ___ Haskell mailing list Haskell@haskell.org

Re: [Haskell] LiftA2 over fmap

2018-01-30 Thread Edward Kmett
> In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to (fmap

Re: Superclass Cycle via Associated Type

2011-07-21 Thread Edward Kmett
to do this. -Edward Kmett ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: Superclass Cycle via Associated Type

2011-07-22 Thread Edward Kmett
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: Superclass Cycle via Associated Type

2011-07-23 Thread Edward Kmett
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 the MPTC route, I just think the two separate

Re: Superclass Cycle via Associated Type

2011-07-25 Thread Edward Kmett
On Mon, Jul 25, 2011 at 4:46 AM, Simon Peyton-Jones simo...@microsoft.comwrote: On further reflection I have a question. ** ** Under the limited design below, which Edward says will do all he wants:*** * **· **The mutually recursive classes (call them A, B, C) must be

Re: Superclass Cycle via Associated Type

2011-07-25 Thread Edward Kmett
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) = Immutable t where frozenThawed :: t -

Re: Superclass Cycle via Associated Type

2011-07-25 Thread Edward Kmett
On Mon, Jul 25, 2011 at 1:40 PM, Jacques Carette care...@mcmaster.cawrote: ** On 25/07/2011 9:55 AM, Edward Kmett wrote: If you have an associative (+), then you can use (.*) to multiply by a whole number, I currently do fold a method into the Additive class to 'fake' a LeftModule

Re: What are the preconditions of newArray#

2011-08-22 Thread Edward Kmett
It would still be nice to have a consistent base case. On Mon, Aug 22, 2011 at 3:43 AM, Johan Tibell johan.tib...@gmail.comwrote: On Mon, Aug 22, 2011 at 5:55 AM, Edward Z. Yang ezy...@mit.edu wrote: stg_newArrayzh in rts/PrimOps.cmm doesn't appear to give any indication, so this might be a

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

2011-09-01 Thread Edward Kmett
On Thu, Sep 1, 2011 at 8:49 AM, Simon Marlow marlo...@gmail.com wrote: On 01/09/2011 08:44, Evan Laforge wrote: Yes, the plan was to eventually have a parallel --make mode. If that's the goal, wouldn't it be easier to start many ghcs? It's an interesting idea that I hadn't thought of.

Re: deep record update

2011-09-19 Thread Edward Kmett
If you use lenses you can do this today with no real need to adulterate the parser. setL (l2 . l1) x rec This goes one step further as it can be written point free so you don't even have to give rec a name if you don't want to. ;) -Edward On Mon, Sep 19, 2011 at 9:09 AM, Barney Hilken

Re: C, GCL interface

2011-11-01 Thread Edward Kmett
The major concern that I would have is that if GCL or any of those math libraries uses GMP behind the scenes, which they probably do, then things will just start crashing on you, because GHC hooks the GMP allocator and will just start making the limbs of their numbers disappear. -Edward On Tue,

Re: Records in Haskell

2011-11-07 Thread Edward Kmett
On Mon, Nov 7, 2011 at 1:33 PM, Wolfgang Jeltsch g9ks1...@acme.softbase.org wrote: Am Montag, den 07.11.2011, 18:16 +0100 schrieb Claus Reinke: I am unsure which of this list of proposals you are referring to. The URL you quote is this

Re: Records in Haskell

2011-11-07 Thread Edward Kmett
Ian said class Has (r :: *) (ft :: *) (f :: ft) (t :: *) where (where ft stands for field type)? class Has (r :: *) (f :: ft) (t :: *) where would be my understanding of how it would be phrased under the current polymorphic kind system. This could also solve the representation-hiding

Re: Why not allow empty record updates?

2011-11-15 Thread Edward Kmett
Sent from my iPad On Nov 15, 2011, at 7:18 PM, wren ng thornton w...@freegeek.org wrote: 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

Re: ConstraintKinds and default associated empty constraints

2011-12-22 Thread Edward Kmett
On Wed, Dec 21, 2011 at 6:45 PM, 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: 7.4.1-pre: Show Integral

2011-12-22 Thread Edward Kmett
7.0.x agrees with the standard. 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. The simplest fix is to simply add an Eq or Show constraint to the few functions that

Re: ConstraintKinds and default associated empty constraints

2011-12-23 Thread Edward Kmett
...@haskell.org] On Behalf Of Edward Kmett Sent: 22 December 2011 17:03 To: Bas van Dijk Cc: glasgow-haskell-users@haskell.org Subject: Re: ConstraintKinds and default associated empty constraints On Wed, Dec 21, 2011 at 6:45 PM, Bas van Dijk v.dijk@gmail.com wrote: I'm playing a bit

Re: ConstraintKinds and default associated empty constraints

2011-12-23 Thread Edward Kmett
On Fri, Dec 23, 2011 at 10:17 AM, Simon Peyton-Jones simo...@microsoft.comwrote: Right now it seems it is either * or Constraint depending on context. *** * ** ** Correct. Tuple bracket are used for both types and Constraints, and we have to decide which from context. ** Whew,

Re: ConstraintKinds and default associated empty constraints

2012-01-09 Thread Edward Kmett
On Sun, Jan 8, 2012 at 8:32 AM, Bas van Dijk v.dijk@gmail.com wrote: On 23 December 2011 17:44, Simon Peyton-Jones simo...@microsoft.com wrote: My attempt at forming a new understanding was driven by your example. class Functor f where type C f :: * - Constraint type C f =

Re: renamed GMP symbols in GHC

2012-01-09 Thread Edward Kmett
it would lead to would be one of bringing over all of their internals into Haskell. ;) -Edward Kmett ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: DefaultSignatures and MultiParamTypeClasses

2012-01-17 Thread Edward Kmett
Great! This will greatly reduce the boilerplate in the constraints package. Sent from my iPhone On Jan 16, 2012, at 9:15 AM, Simon Peyton-Jones simo...@microsoft.com wrote: | /tmp/Test.hs:4:1: | The multi-parameter class `C' cannot have generic methods | In the class declaration

Re: Type operators in GHC

2012-01-18 Thread Edward Kmett
I can live with it and I probably have as many packages as anyone that will be broken by it. =/ Things like http://hackage.haskell.org/packages/archive/categories/0.58.0.5/doc/html/src/Control-Category-Cartesian-Closed.html will need a pretty invasive rewrite, but the simplicity is worth it,

Re: Changes to Typeable

2012-02-11 Thread Edward Kmett
In practice I've found that working with Tagged is a huge pain relative to working with Proxy. You usually need to use ScopedTypeVariables or do asTypeOf/asArgOf tricks that are far more complicated than they need to be. For reference you can compare the internals of reflection before when it

Re: Changes to Typeable

2012-02-13 Thread Edward Kmett
You could probably get away with something like data Proxy = Proxy a class Typeable a where typeOfProxy :: Proxy a - TypeRep typeOf :: forall a. Typeable a = a - TypeRep typeOf = typeOfProxy (Proxy :: Proxy a) which being outside of the class won't contribute to the inference of 'a's kind.

Re: Changes to Typeable

2012-02-13 Thread Edward Kmett
On Mon, Feb 13, 2012 at 3:27 PM, Simon Marlow marlo...@gmail.com wrote: On 13/02/12 18:16, Edward Kmett wrote: You could probably get away with something like data Proxy = Proxy a class Typeable a where typeOfProxy :: Proxy a - TypeRep typeOf :: forall a. Typeable a = a - TypeRep

Re: Changes to Typeable

2012-02-14 Thread Edward Kmett
Sent from my iPhone On Feb 14, 2012, at 3:00 AM, Roman Leshchinskiy r...@cse.unsw.edu.au wrote: On 13/02/2012, at 11:10, Simon Peyton-Jones wrote: | Should there perhaps be a NewTypeable module which could then be renamed | into Typeable once it is sufficiently well established? I

Re: Changes to Typeable

2012-02-14 Thread Edward Kmett
On Tue, Feb 14, 2012 at 11:18 AM, Iavor Diatchki iavor.diatc...@gmail.comwrote: Hello, On Mon, Feb 13, 2012 at 5:32 PM, Edward Kmett ekm...@gmail.com wrote: There are fewer combinators from commonly used classes for working with the left argument of a bifunctor, however. I think

Re: Holes in GHC

2012-02-18 Thread Edward Kmett
Not sure if I misparsed your response or not. Its not just things that can or could match the type of the scope, but basically anything introduced in local scopes around the hole, those can have types that you can't talk about outside of a local context, due to existentials that were opened, etc.

Boxed foreign prim

2012-03-08 Thread Edward Kmett
I'm currently working with a lot of very short arrays of fixed length and as a thought experiment I thought I would try to play with fast numeric field accessors In particular, I'd like to use something like foreign prim to do something like foreign import prim cmm_getField unsafeField# :: a -

Re: Boxed foreign prim

2012-03-12 Thread Edward Kmett
On Mon, Mar 12, 2012 at 6:45 AM, Simon Marlow marlo...@gmail.com wrote: But I can only pass unboxed types to foreign prim. Is this an intrinsic limitation or just an artifact of the use cases that have presented themselves to date? It's an intrinsic limitation - the I# box is handled

Re: Boxed foreign prim

2012-03-13 Thread Edward Kmett
On Tue, Mar 13, 2012 at 4:57 AM, Simon Marlow marlo...@gmail.com wrote: On 12/03/2012 14:22, Edward Kmett wrote: On Mon, Mar 12, 2012 at 6:45 AM, Simon Marlow marlo...@gmail.com mailto:marlo...@gmail.com wrote: But I can only pass unboxed types to foreign prim

Re: faking universal quantification in constraints

2012-04-17 Thread Edward Kmett
On Mon, Apr 16, 2012 at 6:57 PM, Nicolas Frisby nicolas.fri...@gmail.comwrote: I'm simulating skolem variables in order to fake universal quantification in constraints via unsafeCoerce. http://hpaste.org/67121 I'm not familiar with various categories of types from the run-time's

Re: faking universal quantification in constraints

2012-04-17 Thread Edward Kmett
On Tue, Apr 17, 2012 at 6:40 PM, Nicolas Frisby nicolas.fri...@gmail.comwrote: I built a (really ugly) dictionary for (Int ~ Char) using Data.Constraints.Forall. I'm fairly confident it could be generalized to a polymorphic coercion (a ~ b). http://hpaste.org/67180 I cheated with

Re: Kindness of strangers (or strangeness of Kinds)

2012-06-09 Thread Edward Kmett
ghci :k Maybe Maybe :: * - * On Sat, Jun 9, 2012 at 1:34 AM, Rustom Mody rustompm...@gmail.com wrote: On Thu, Jun 7, 2012 at 7:16 AM, AntC anthony_clay...@clear.net.nz wrote: I'm confused about something with promoted Kinds (using an example with Kind- promoted Nats). This is in GHC

Re: Kindness of strangers (or strangeness of Kinds)

2012-06-11 Thread Edward Kmett
On Mon, Jun 11, 2012 at 9:58 PM, AntC anthony_clay...@clear.net.nz wrote: Simon Peyton-Jones simonpj at microsoft.com writes: There is a little, ill-documented, sub-kind hierarchy in GHC. I'm trying hard to get rid of it as much as possible, and it is much less important than it used to

Re: Call to arms: lambda-case is stuck and needs your help

2012-07-05 Thread Edward Kmett
I really like the \of proposal! It is a clean elision with \x - case x of becoming \of I still don't like it directly for multiple arguments. One possible approach to multiple arguments is what we use for multi-argument case/alt here in our little haskell-like language, Ermine, here at SP

Re: Call to arms: lambda-case is stuck and needs your help

2012-07-06 Thread Edward Kmett
that it introduces a layout rule doesn't change any of the rules for when layout is introduced. On Jul 5, 2012, at 5:33 PM, Twan van Laarhoven twa...@gmail.com wrote: On 2012-07-05 23:04, Edward Kmett wrote: A similar generalization can be applied to the expression between case and of to permit

Re: Call to arms: lambda-case is stuck and needs your help

2012-07-06 Thread Edward Kmett
) (Just y) = Just (x + y) bar''' _ _ = Nothing -Edward On Fri, Jul 6, 2012 at 3:12 AM, Edward Kmett ekm...@gmail.com wrote: Oh, neat. I guess it does. :) I'll hack that into my grammar when I get into work tomorrow. My main point with that observation is it cleanly allows for multiple argument

PolyKinds, Control.Category and GHC 7.6.1

2012-08-13 Thread Edward Kmett
that directly benefits from PolyKinds without any code changes, but without enabling the extension there nobody can define categories for kinds other than *, and most interesting categories actually have more exotic kinds. I only noticed that it wasn't there in the release candidate just now. -Edward Kmett

Re: PolyKinds, Control.Category and GHC 7.6.1

2012-08-13 Thread Edward Kmett
and existing code continues to work. This change actually could have been applied in 7.4.1. -Edward Kmett ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Re: GADTs in the wild

2012-08-14 Thread Edward Kmett
:: (*,*) - * - * where NDL :: (a - c) - NonDetFork '(a, b) c NDR :: (b - c) - NonDetFork '(a, b) c NDB :: (a - b) - (b - c) - NonDetFork '(a, b) c These could admittedly be implemented using a more traditional GADT without poly/data kinds, by just using (a,b) instead of '(a,b), though. -Edward Kmett

Re: GADTs in the wild

2012-08-14 Thread Edward Kmett
On Tue, Aug 14, 2012 at 10:32 AM, Edward Kmett ekm...@gmail.com wrote: data NonDetFork :: (*,*) - * - * where NDL :: (a - c) - NonDetFork '(a, b) c NDR :: (b - c) - NonDetFork '(a, b) c NDB :: (a - b) - (b - c) - NonDetFork '(a, b) c er.. NDB :: (a - *c*) - (b - c) - NonDetFork

Re: Request for comments on proposal for literate programming using markdown

2012-08-21 Thread Edward Kmett
Ultimately your best bet to actually get something integrated will be to find something that minimizes the amount of work on the part of GHC HQ. I don't think *anybody* there is interested in picking up a lot of fiddly formatting logic and carving it into stone. They might be slightly less

Re: Comparing StableNames of different type

2012-08-24 Thread Edward Kmett
You can wind up with StableNames matching even when the types differ. Consider naming [] :: [Int] and [] :: [()]. This is harmless for most usecases. I've used unsafeCoerce to compare StableNames on different types for years without problems. Admittedly, I do find it a bit of an oddity that

Re: Why is Bag's Data instance broken?

2012-08-29 Thread Edward Kmett
I've been meaning to put in a proposal to replace the Data instances for Map, etc. with one that pretends there is a fake 'fromList' constructor that restores the invariants. In my experience this works much better than just making everyone who relies on Data randomly crash, and it preserves the

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

2012-08-30 Thread Edward Kmett
If I define the following {-# LANGUAGE FunctionalDependencies, GADTs, KindSignatures, MultiParamTypeClasses, PolyKinds, RankNTypes, TypeOperators, DefaultSignatures, DataKinds, FlexibleInstances, UndecidableInstances #-} module Indexed.Test where class IMonad (m :: (k - *) - k - *) where

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

2012-08-31 Thread Edward Kmett
dependencies involving kinds are supported. Are you compiling with a version of 7.6 updated since that bug fix? Richard On Aug 30, 2012, at 10:38 PM, Edward Kmett wrote: If I define the following {-# LANGUAGE FunctionalDependencies, GADTs, KindSignatures, MultiParamTypeClasses, PolyKinds

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

2012-08-31 Thread Edward Kmett
** ** irt :: a x - Thrist a x irt ax = ax :- Nil ** ** ** ** *From:* glasgow-haskell-users-boun...@haskell.org [mailto: glasgow-haskell-users-boun...@haskell.org] *On Behalf Of *Edward Kmett *Sent:* 31 August 2012 03:38 *To:* glasgow-haskell-users@haskell.org *Subject:* PolyKind issue

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

2012-08-31 Thread Edward Kmett
. On Fri, Aug 31, 2012 at 8:55 AM, Edward Kmett ekm...@gmail.com wrote: Hrmm. This seems to work manually for getting product categories to work. Perhaps I can do the same thing for thrists. {-# LANGUAGE PolyKinds, DataKinds, TypeOperators, GADTs, TypeFamilies #-} module Product where import

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

2012-08-31 Thread Edward Kmett
On Fri, Aug 31, 2012 at 9:37 AM, Richard Eisenberg e...@cis.upenn.eduwrote: I ran into this same issue in my own experimentation: if a type variable x has a kind with only one constructor K, GHC does not supply the equality x ~ K y for some fresh type variable y. Perhaps it should. I too had

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

2012-08-31 Thread Edward Kmett
a a bidStar = bidT :* bidT ** ** data T a b = MkT ** ** bidT :: T a a bidT = MkT ** ** ** ** ** ** *From:* Edward Kmett [mailto:ekm...@gmail.com] *Sent:* 31 August 2012 13:45 *To:* Simon Peyton-Jones *Cc:* glasgow-haskell-users@haskell.org *Subject:* Re

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

2012-08-31 Thread Edward Kmett
} [sig] ghc-prim:GHC.Prim.BOX{(w) tc 347} I'll try to distill this down to a reasonable test case. -Edward On Fri, Aug 31, 2012 at 1:26 PM, Edward Kmett ekm...@gmail.com wrote: It is both perfectly reasonable and unfortunately useless. :( The problem is that the more polymorphic type isn't

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

2012-08-31 Thread Edward Kmett
** ** *From:* Edward Kmett [mailto:ekm...@gmail.com ekm...@gmail.com] *Sent:* 31 August 2012 18:27 *To:* Simon Peyton-Jones *Cc:* glasgow-haskell-users@haskell.org *Subject:* Re: PolyKind issue in GHC 7.6.1rc1: How to make a kind a functional dependency? ** ** It is both perfectly

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

2012-09-05 Thread Edward Kmett
I've come to think the culprit here is the fallacy that Any should inhabit every kind. I realize this is useful from an implementation perspective, but it has a number of far reaching consequences: This means that a product kind isn't truly a product of two kinds. x * y, it winds up as a

Re: Type operators in GHC

2012-09-15 Thread Edward Kmett
One issue with this proposal is it makes it *completely* impossible to pick a type constructor operator that works with both older GHCs and 7.6. It is a fairly elegant choice, but in practice it would force me and many others to stop using them completely for the next couple of years, as I

Re: Type operators in GHC

2012-09-17 Thread Edward Kmett
Iavor: Wow, I really like the --c-- trick at the type level. Note: we can shorten that somewhat and improve the fixity to associate correctly, matching the associativity of (-), which fortunately associates to the right. (associating to the left can be done with a similar trick, based on the

Re: Type operators in GHC

2012-09-17 Thread Edward Kmett
On Mon, Sep 17, 2012 at 1:02 PM, Sjoerd Visscher sjo...@w3future.comwrote: Hi, Note that nobody was suggesting two pragmas with incompatible behaviors, only to have just one symbol reserved to still be able to have type operator variables. An issue with reserving a symbol for type operator

Re: Why is Bag's Data instance broken?

2012-09-20 Thread Edward Kmett
Data.Data (see http://hackage.haskell.org/trac/ghc/ticket/7256). I think those are just a bug, unrelated to the abstraction story, no? Cheers, Pedro On Thu, Sep 20, 2012 at 12:19 PM, Edward Kmett ekm...@gmail.com wrote: Note: It was probably built with an eye towards how Data.Map and the like

Re: Comments on current TypeHoles implementation

2012-10-03 Thread Edward Kmett
On Wed, Oct 3, 2012 at 11:44 AM, Sean Leather leat...@cs.uu.nl wrote: Hi Simon, Thanks for all your work in getting TypeHoles into HEAD. We really appreciate it. I was playing around with HEAD today and wanted to share a few observations. (1) One of the ideas we had was that a hole `_'

Re: Comments on current TypeHoles implementation

2012-10-04 Thread Edward Kmett
I really like this proposal. -Edward On Thu, Oct 4, 2012 at 5:40 AM, Simon Peyton-Jones simo...@microsoft.comwrote: There is also the small matter, in this example, of distinguishing which `_' is which. The description works, but you have to think about it. I don't have an immediate and

Re: Generating random type-level naturals

2012-11-16 Thread Edward Kmett
, then it doesn't matter what the actual value is since we're capable of eliminating all of them: reifyInt :: Int - (forall n. ReflectNum n = n - a) - a This is just the standard CPS trick we also use for dealing with existentials and other pesky types we're not allowed to see. Edward Kmett

Re: Newtype wrappers

2013-01-14 Thread Edward Kmett
Many of us definitely care. =) The main concern that I would have is that the existing solutions to this problem could be implemented while retaining SafeHaskell, and I don't see how a library that uses this can ever recover its SafeHaskell guarantee. Here is a straw man example of a solution

Re: Newtype wrappers

2013-01-14 Thread Edward Kmett
“is a functor of its second type argument” for a type constructor of three arguments. ** ** Simon ** ** ** ** ** ** *From:* Edward Kmett [mailto:ekm...@gmail.com] *Sent:* 14 January 2013 18:39 *To:* Simon Peyton-Jones *Cc:* GHC users *Subject:* Re: Newtype wrappers

Re: Newtype wrappers

2013-01-14 Thread Edward Kmett
even have a good way to say “is a functor of its second type argument” for a type constructor of three arguments. ** ** Simon ** ** ** ** ** ** *From:* Edward Kmett [mailto:ekm...@gmail.com] *Sent:* 14 January 2013 18:39 *To:* Simon Peyton-Jones *Cc:* GHC users *Subject

Re: Newtype wrappers

2013-01-14 Thread Edward Kmett
No magic coercing is present in the proposal. You need to use explicit newtype wrap and newtype unwrap expressions. Sent from my iPad On Jan 14, 2013, at 6:42 PM, Johan Tibell johan.tib...@gmail.com wrote: On Mon, Jan 14, 2013 at 3:40 PM, Evan Laforge qdun...@gmail.com wrote: Wait, what's

Re: base package (Was: GHC 7.8 release?)

2013-02-21 Thread Edward Kmett
Comparing hash, ptr, str gives you a pretty good acceptance/rejection test. hash for the quick rejection, ptr for quick acceptance, str for accuracy. Especially since the particular fingerprints for Typeable at least are usually made up of 3 bytestrings that were just stuffed in and forgotten

Re: Overloaded record fields

2013-06-26 Thread Edward Kmett
Note: the lens solution already gives you 'reverse function application' with the existing (.) due to CPS in the lens type. -Edward On Wed, Jun 26, 2013 at 4:39 PM, Simon Peyton-Jones simo...@microsoft.comwrote: | record projections. I would prefer to have dot notation for a | general,

Re: Overloaded record fields

2013-06-26 Thread Edward Kmett
Let me take a couple of minutes to summarize how the lens approach tackles the composition problem today without requiring confusing changes in the lexical structure of the language. I'll digress a few times to showcase how this actually lets us make more powerful tools than are available in

Re: Overloaded record fields

2013-06-27 Thread Edward Kmett
On Thu, Jun 27, 2013 at 2:14 AM, AntC anthony_clay...@clear.net.nz wrote: Edward Kmett ekmett at gmail.com writes: Let me take a couple of minutes to summarize how the lens approach tackles the composition problem today without requiring confusing changes in the lexical structure

Re: A possible alternative to dot notation for record access

2013-06-30 Thread Edward Kmett
(#) is a legal operator today and is used in a number of libraries. On Sun, Jun 30, 2013 at 11:38 PM, amin...@gmail.com wrote: As long as we're bikeshedding... Possibly '#' is unused syntax -- Erlang uses it for its records too, so we wouldn't be pulling it out of thin air. E.g.

Field accessor type inference woes

2013-07-01 Thread Edward Kmett
It strikes me that there is a fairly major issue with the record proposal as it stands. Right now the class class Has (r :: *) (x :: Symbol) (t :: *) can be viewed as morally equivalent to having several classes class Foo a b where foo :: a - b class Bar a b where bar

Re: Field accessor type inference woes

2013-07-01 Thread Edward Kmett
putting dummies in scope just to force conflict. -Edward Thanks, Adam On 01/07/13 15:48, Edward Kmett wrote: It strikes me that there is a fairly major issue with the record proposal as it stands. Right now the class class Has (r :: *) (x :: Symbol) (t :: *) can be viewed

Re: Field accessor type inference woes

2013-07-02 Thread Edward Kmett
On Tue, Jul 2, 2013 at 4:53 AM, AntC anthony_clay...@clear.net.nz wrote: I was envisaging that we might well need a functional dependency Hi Adam, Edward, (Simon), I think we should be really careful before introducing FunDeps (or type functions). Can we get to the needed type

Re: How to fix DatatypeContexts?

2013-07-18 Thread Edward Kmett
This is exactly what GADTs are for. -Edward On Thu, Jul 18, 2013 at 6:54 AM, harry volderm...@hotmail.com wrote: data Eq a = Pair a = Pair {x::a, y::a} equal :: Pair a - Bool equal pair = (x pair) == (y pair) This code will fail to compile, even with the deprecated DatatypeContexts

Re: Liberalising IncoherentInstances

2013-07-29 Thread Edward Kmett
I'll probably never use it, but I can't see any real problems with the proposal. In many ways it is what I always expected IncoherentInstances to be. One thing you might consider is that if you have to make an arbitrary instance selection at the end during compile time, making that emit a warning

Re: Desugaring do-notation to Applicative

2013-10-02 Thread Edward Kmett
That is admittedly a pretty convincing example that we may want to provide either a LANGUAGE pragma or a different syntax to opt in. As a data point in this space, the version of the code I have in scheme calls the version of 'do' that permits applicative desugaring 'ado'. A port of it to Haskell

Re: default roles

2013-10-09 Thread Edward Kmett
I just noticed there is a pretty big issue with the current default role where typeclasses are concerned! When implementing Data.Type.Coercion I had to use the fact that I could apply coerce to the arguments of data Coercion a b where Coercion :: Coercible a b = Coercion a b This makes sense

Re: default roles

2013-10-09 Thread Edward Kmett
role be nominal? Richard On Oct 9, 2013, at 1:55 PM, Edward Kmett ekm...@gmail.com wrote: I just noticed there is a pretty big issue with the current default role where typeclasses are concerned! When implementing Data.Type.Coercion I had to use the fact that I could apply coerce

Re: default roles

2013-10-09 Thread Edward Kmett
On Wed, Oct 9, 2013 at 3:21 PM, Richard Eisenberg e...@cis.upenn.edu wrote: Now I think we're on the same page, and I *am* a little worried about the sky falling because of this. (That's not a euphemism -- I'm only a little worried.) =) Wait! I have an idea! The way I've been describing

Re: default roles

2013-10-09 Thread Edward Kmett
to be coerced. On Oct 9, 2013, at 2:52 PM, Edward Kmett ekm...@gmail.com wrote: I'd be happy to be wrong. =) We do seem to have stumbled into a design paradox though. To make it so you can use roles in GeneralizedNewtypeDeriving hinges on the parameter's role being representational, but making

Re: Why cannot inferred type signatures restrict (potentially) ambiguous type variables?

2013-10-14 Thread Edward Kmett
AllowAmbiguousTypes at this point only extends to signatures that are explicitly written. This would need a new AllowInferredAmbiguousTypes or something. On Sat, Oct 12, 2013 at 5:34 PM, adam vogt vogt.a...@gmail.com wrote: Hello, I have code: {-# LANGUAGE FlexibleInstances,

  1   2   3   4   5   >