Re: [Haskell-cafe] Conditional lens

2013-10-10 Thread Edward Kmett
`ifL` isn't a legal lens for several reasons. Lens s t a b generally requires that the types a subsumes b and b subsumes a, and that s subsumes t and t subsumes s. Lens s (Maybe t) (Maybe a) b is a huge red flag. There is an 'illegal prism' provided by lens that is a more principled version of t

Re: [Haskell-cafe] Proposal: Partitionable goes somewhere + containers instances

2013-09-30 Thread Edward Kmett
;d be happy either way, as long > as I get at least the cheap one (i.e. prefer imbalance to restructuring). > > -Ryan > > > > > On Sun, Sep 29, 2013 at 8:20 AM, Edward Kmett wrote: > >> I don't know that it belongs in the "standard" libraries, but ther

Re: [Haskell-cafe] Proposal: Partitionable goes somewhere + containers instances

2013-09-29 Thread Edward Kmett
I don't know that it belongs in the "standard" libraries, but there could definitely be a package for something similar. ConstraintKinds are a pretty hefty extension to throw at it, and the signature written there prevents it from being used on ByteString, Text, etc. This can be implemented with

Re: [Haskell-cafe] Impredicative types and Lens?

2013-09-08 Thread Edward Kmett
You can't write that lens by hand, so it isn't surprising that the template haskell can't generate it either. =) ImpredicativeTypes don't work all that well. -Edward On Sun, Sep 8, 2013 at 9:49 AM, Artyom Kazak wrote: > Here’s a small example, which, when compiled, gives an error. Why? > >

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-31 Thread Edward Kmett
Or fmap in this case =) On Wed, Jul 31, 2013 at 11:33 AM, Erik Hesselink wrote: > On Fri, Jul 26, 2013 at 6:44 PM, Andreas Abel > wrote: > > mapSnd f = (id *** f) > > As a very small aside, this is just `second` from Control.Arrow. > > Erik > > ___ >

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-25 Thread Edward Kmett
I'm just going to say that I'd rather we didn't resort to calling each others trolls. I happen to disagree with Oleg on this particular issue and find that it is better resolved by just using -Wall or a 2-line combinator, but I find that across the breadth and depth of issues in the Haskell ecosys

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-24 Thread Edward Kmett
> x does *not* appear strictly in S x > > if S is a lazy constructor. > > > On 22.07.13 4:54 PM, Edward Kmett wrote: > >> let x = x +1 >> >> is perfectly cromulent when x is sufficiently lazy, e.g. in the one point >> compactification

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-22 Thread Edward Kmett
let x = x +1 is perfectly cromulent when x is sufficiently lazy, e.g. in the one point compactification of the naturals: data Conat = S Conat | Z There it represents infinity with proper sharing. -Edward On Jul 22, 2013, at 10:24 AM, Andreas Abel wrote: > On 22.07.2013 10:50, MigMit wrote:

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-17 Thread Edward Kmett
FWIW, I maintain, according to wc and sloccount, 220841 lines worth of Haskell code at present. I have been bitten this error one time, so it affects me .45% of the time and that was only because it was in the only package I was not using -Wall on. -Edward On Wed, Jul 17, 2013 at 12:23 PM, A

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-17 Thread Edward Kmett
This happened because I copied the surrounding style blindly. I fucked up. state f = get >>= \s -> case f s of (a, s) -> do put s return a would not have the problem and would have given a warning about name shadowing. I for one am somewhat neutral on the *adding* a non-recursive le

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-11 Thread Edward Kmett
as the do-notation. > > > On 11.07.2013 17:40, Carter Schonwald wrote: > >> Yup. Nested cases *are* non recursive lets. >> >> (Can't believe I forgot about that ) >> >> On Thursday, July 11, 2013, Edward Kmett wrote: >> >> On Wed, J

Re: [Haskell-cafe] Proposal: Non-recursive let

2013-07-11 Thread Edward Kmett
On Wed, Jul 10, 2013 at 3:47 AM, wrote: > > Jon Fairbairn wrote: > > It just changes forgetting to use different variable names because of > > recursion (which is currently uniform throughout the language) to > > forgetting to use non recursive let instead of let. > > Let me bring to the record t

[Haskell-cafe] [haskell.org Google Summer of Code] The Summer of Code is officially under way.

2013-06-18 Thread Edward Kmett
The "getting to know your mentor" period has passed and the Summer of Code has officially begun. Keep in mind that mid-term evaluations will begin July 29th, so students will need to hit the ground running. I'm looking forward to seeing what we can accomplish together this year! -Edward

Re: [Haskell-cafe] [haskell.org Google Summer of Code 2013] Approved Projects

2013-06-02 Thread Edward Kmett
> wanted it". Maybe we should use something like: https://www.uservoice.com. > Sadly it seems this requires payment but there may be a free equivalent > > Dominic Steinitz > domi...@steinitz.org > http://idontgetoutmuch.wordpress.com > > On 28 May 2013, at 16:11, Edward

Re: [Haskell-cafe] [haskell.org Google Summer of Code 2013] Approved Projects

2013-05-29 Thread Edward Kmett
on Qt per se but it is good to keep such a concrete goal in mind when working on something as abstract as SWIG. I agree that Qt has a somewhat horrible API. =) -Edward On Wed, May 29, 2013 at 12:34 PM, harry wrote: > Edward Kmett gmail.com> writes: > > > There should be a

Re: [Haskell-cafe] [haskell.org Google Summer of Code 2013] Approved Projects

2013-05-29 Thread Edward Kmett
There should be a link from the google-melange website, but one slight shift in focus is on either getting SWIG bindings or possibly even using Ian-Woo Kim's C++FFI tools. Carter may be able to go into more detail. On Wed, May 29, 2013 at 6:46 AM, harry wrote: > Edward Kmett gmail.com

Re: [Haskell-cafe] [haskell.org Google Summer of Code 2013] Approved Projects

2013-05-28 Thread Edward Kmett
rove it. I just can't think of such a proposal that we've had in recent years. -Edward On Tue, May 28, 2013 at 8:24 PM, Ben Lippmeier wrote: > > On 29/05/2013, at 1:11 AM, Edward Kmett wrote: > > This unfortunately means, that we can't really show the unaccepte

Re: [Haskell-cafe] [haskell.org Google Summer of Code 2013] Approved Projects

2013-05-28 Thread Edward Kmett
If you have any more questions or if my answer didn't suffice please feel free to follow up! -Edward Kmett On Tue, May 28, 2013 at 6:52 AM, Dominic Steinitz wrote: > Hi Edward, > > Although the project I am interested in (as a user) has been accepted :-), > I can't help

[Haskell-cafe] [haskell.org Google Summer of Code 2013] Approved Projects

2013-05-27 Thread Edward Kmett
d to make a few hard decisions. Shachaf Ben-Kiki is helping out as this year's backup administrator and he should also be able to help out with administrivia or questions as well. I'd like to thank everyone for participating in the selection process and I think we can look forward to another

Re: [Haskell-cafe] Infrastructure for testing the impact of a Functor/Applicative/Monad hierarchy

2013-05-16 Thread Edward Kmett
There is a chicken and the egg problem with this argument. Historically Haskell' has only considered changes that have been actually implemented. I would encourage the language standard to follow suit, but we survived a similar autocratic minor change to Num with very little ecosystem disruption.

Re: [Haskell-cafe] Backward compatibility

2013-05-03 Thread Edward Kmett
So basically it boiled down drop the haskell98 package dependency and use the new exception system, and import the right things to avoid the use of the no longer exported Prelude catch? On Fri, May 3, 2013 at 12:44 PM, Niklas Hambüchen wrote: > While I certainly enjoy the discussion, how about

Re: [Haskell-cafe] Backward compatibility

2013-05-03 Thread Edward Kmett
"Tantamount to a new language" to fix a minor detail in a typeclass hierarchy? That is just histrionic. *No* language is that stable. Scala makes dozens of changes like that between *minor* versions, and while I hardly hold up their development practices as the best in the industry it is still som

Re: [Haskell-cafe] Why were datatype contexts removed instead of "fixing them"?

2013-04-26 Thread Edward Kmett
That is because every other language conflates the notion of a class with a vtable smashed into every inhabitant of the class where everything has to be defined together in one monolithic definition. You also can't write sensible Monads in those languages (Where does return go?) or retroactively d

Re: [Haskell-cafe] Automated Differentiation of Matrices (hmatrix)

2013-04-10 Thread Edward Kmett
AD s a0 > Actual type: MyMatrix Double -> Double > In the first argument of `grad', namely `g' > In the expression: grad g > > > If so that would help as at least I could then convert between e.g. repa > and structures that ad can play with. Of course,

Re: [Haskell-cafe] Automated Differentiation of Matrices (hmatrix)

2013-04-09 Thread Edward Kmett
hmatrix and ad don't (currently) mix. The problem is that hmatrix uses a packed structure that can't hold any of the AD mode variants we have as an Element. =( I've been working with Alex Lang to explore in ad 4.0 ways that we can support monomorphic AD modes and still present largely the same AP

[Haskell-cafe] [haskell.org Summer of Code 2013] We're In!

2013-04-08 Thread Edward Kmett
ee to pester me (or Shachaf) with questions! -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Need some advice around lazy IO

2013-03-18 Thread Edward Kmett
Konstantin, Please allow me to elaborate on Dan's point -- or at least the point that I believe that Dan is making. Using, let bug = Control.DeepSeq.rnf str `seq` fileContents2Bug str or ($!!) will create a value that *when forced* cause the rnf to occur. As you don't look at bug until much l

Re: [Haskell-cafe] Safe lens?

2012-10-29 Thread Edward Kmett
cidental > toggleage. Still, it's puzzling that the status of "Safe-Infered" was > lost. > > On Mon, Oct 29, 2012 at 2:46 PM, Edward Kmett wrote: > > I fixed it. Version 3.0.6 was just uploaded to hackage and is > appropriately > > Trustworthy where need

Re: [Haskell-cafe] Safe lens?

2012-10-29 Thread Edward Kmett
d give reasons for "None" / > tell what would have made it unsafe in the event of "Trustworthy". > Particularly fancy if integrated into the haddocks. > > -mgsloan > > On Mon, Oct 29, 2012 at 2:33 PM, Edward Kmett wrote: > > Actually Control.Lens.Getter

Re: [Haskell-cafe] Safe lens?

2012-10-29 Thread Edward Kmett
Actually Control.Lens.Getter doesn't use TH. The issue is more that it depends on some modules I didn't flag as Trustworthy and which require some more high-falutin type system extensions that GHC isn't happy about treating as Safe. I'll try adding a few Trustworthy flags. It previously was treate

[Haskell-cafe] haddock changes between 2.10 and 2.12?

2012-09-24 Thread Edward Kmett
Was there some significant change/bug introduced to haddock made between 2.10 and 2.12? When I look at the haddocks for kan-extensions 3.1: Data.Functor.Yoneda which purports to have been built by had

Re: [Haskell-cafe] Have you seen this functor/contrafunctor combo?

2012-06-09 Thread Edward Kmett
As an aside, the Union constraint on epsilon/gepsilon is only needed for the :+: case, you can search products just fine with any old contravariant functor, as you'd expect given the existence of the Applicative. -Edward On Sat, Jun 9, 2012 at 6:28 PM, Edward Kmett wrote: > H

Re: [Haskell-cafe] Have you seen this functor/contrafunctor combo?

2012-06-09 Thread Edward Kmett
Here is a considerably longer worked example using the analogy to J, borrowing heavily from Wadler: As J, this doesn't really add any power, but perhaps when used with non-representable functors like Equivalence/Comparison you can do something more interesting. -- Used for Hilbert {-# LANGUAGE De

Re: [Haskell-cafe] Problem Installing ad (Automatic Differentiation) Package

2012-04-21 Thread Edward Kmett
I'll need to get an older ghc version installed, so I can try to figure out what changes are needed to make template haskell bits compatible back to the current platform. 'ad' uses TH rather extensively, and sadly, the update to support ghc 7.4.1 broke a fair bit of the old code gen -- as I reca

Re: [Haskell-cafe] Un-memoization

2012-03-23 Thread Edward Kmett
It depends on how you are building the tree. If you are building up the tree from repeated substitution at the leaves and never reference its body before you do the final fold, you may be able to exploit the fact that trees form a free monad, and that there is a nice construction for increasing th

[Haskell-cafe] Google Summer of Code 2012

2012-03-19 Thread Edward Kmett
e.net Thank you all very much and we look forward to another successful Summer of Code! -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] We *have* been accepted into the Google Summer of Code

2012-03-16 Thread Edward Kmett
Just to clarify, since I've been getting a ton of emails on the topic, we *have* been accepted to the Google Summer of Code this year. The list on their site is still updating, and we should appear there shortly. -Edward ___ Haskell-Cafe mailing list Ha

Re: [Haskell-cafe] ANN: Haskell OpenGL package updates

2011-10-30 Thread Edward Kmett
11 at 2:07 PM, Edward Kmett wrote: >> Jason, >> Thank you for taking ownership of HOpenGL! > > Thanks! > >> I would like to make a formal request for there to be some way to get access >> to either >> Graphics.Rendering.OpenGL.Raw.Core31.TypesInternal >

Re: [Haskell-cafe] ANN: Haskell OpenGL package updates

2011-10-28 Thread Edward Kmett
Jason, Thank you for taking ownership of HOpenGL! I would like to make a formal request for there to be *some* way to get access to either Graphics.Rendering.OpenGL.Raw.Core31.TypesInternal or that Graphics.Rendering.OpenGL.Raw.Core31.Types re-export the newtype wrappers it places around CDou

Re: [Haskell-cafe] ANNOUNCE: Hac Boston from January *20-22* at MIT

2011-10-25 Thread Edward Kmett
Correction: January 20-22nd ;) On Tue, Oct 25, 2011 at 5:45 PM, Edward Kmett wrote: > I am very pleased to officially announce Hac Boston, a Haskell hackathon > to be held January 21-23, 2012 at MIT in Cambridge, MA. > > The hackathon will officially kick off at 2:30 Friday after

[Haskell-cafe] ANNOUNCE: Hac Boston from January 21-23rd at MIT

2011-10-25 Thread Edward Kmett
add it on the wiki<http://haskell.org/haskellwiki/Hac_Boston/Talks> . We look forward to seeing you at MIT! -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] haskell i18n best practices

2011-10-11 Thread Edward Kmett
ot sure its considered "best practice", since I haven't bundled it up for third party use yet, but its *my* practice. ;) -Edward Kmett > This is what I've been looking at lately. The first thing I noticed > was the GNU gettext implementation for Haskell. The wiki page

Re: [Haskell-cafe] Where is SNMap for stable names?

2011-09-23 Thread Edward Kmett
s . using Data.HashTable > > Import Data.HashTable > import Data.Dynamic > > table :: HashTable StableName Dynamic > > table= new (==) hashStableName > > > > > 2011/9/22 Edward Kmett > I have a "stable-maps" package that provides lookup and insert

Re: [Haskell-cafe] Where is SNMap for stable names?

2011-09-23 Thread Edward Kmett
You still need IO to get the stable name out to use. :) Sent from my iPad On Sep 23, 2011, at 5:33 AM, Sean Leather wrote: > Hi Edward, > > On Thu, Sep 22, 2011 at 16:50, Edward Kmett wrote: > I have a "stable-maps" package that provides lookup and inserting into a m

Re: [Haskell-cafe] Where is SNMap for stable names?

2011-09-22 Thread Edward Kmett
Then "don't do that." =) I should have mentioned, parametric keys are a no no and can do bad things. ;) -Edward On Thu, Sep 22, 2011 at 2:33 PM, James Cook wrote: > I may be wrong, but I think the original SNMap was a map from 'StableName's > to the specific values they were derived from, which

Re: [Haskell-cafe] Where is SNMap for stable names?

2011-09-22 Thread Edward Kmett
I have a "stable-maps" package that provides lookup and inserting into a map via stable names. -Edward On Thu, Sep 22, 2011 at 5:47 AM, Sean Leather wrote: > There is an abstract type called SNMap for stable names referred to in [1]. > This has apparently disappeared from GHC a long time ago. I

Re: [Haskell-cafe] regex-applicative library needs your help! (algorithmic challenge)

2011-09-21 Thread Edward Kmett
On Sep 18, 2011, at 11:28 AM, Brandon Allbery wrote: > On Sat, Sep 17, 2011 at 22:11, Anton Tayanovskyy > wrote: > By the way, can Haskell have a type that admits regular expression and > only those? I mostly do ML these days, so trying to write up a regex > types in Haskell I was unpleasantl

Re: [Haskell-cafe] Proposal #3339: Add (+>) as a synonym for mappend

2011-08-14 Thread Edward Kmett
I originally didn't have the package exporting those things. I would be amenable to standardization without them, but I use them in about 20 packages that are built on top of semigroups, and naturals and non-empty lists come up when talking about semigroups a lot. Rather than having them live way

[Haskell-cafe] [Haskell-Cafe] Constructive Probability Theory and RandProc's σ-algebras

2011-07-03 Thread Edward Kmett
On Sun, Jul 3, 2011 at 11:05 AM, David Banas wrote: > v0.4 of `RandProc` has just been posted to Hackage: > http://hackage.haskell.org/package/randproc [NB: I transfered this discussion from haskell to haskell-cafe, and started another thread] I have been spending some time exploring construct

Re: [Haskell-cafe] Data Flow Programming in FP

2011-06-21 Thread Edward Kmett
dic stream type used by Uustalu and Vene is packaged in 'streams' as Data.Stream.Future: http://hackage.haskell.org/packages/archive/streams/0.8.0/doc/html/Data-Stream-Future.html -Edward Kmett On Mon, Jun 20, 2011 at 10:45 AM, Richard Senington wrote: > Hi all, > > I have rece

Re: [Haskell-cafe] Please add a method for optimized concat to the Semigroup class

2011-05-30 Thread Edward Kmett
inductive version (Data.Stream.Future has > that distinction), but it does implement efficiently and it can cheaply > interconvert to [a]. > > -Edward > > > On Tue, May 3, 2011 at 6:49 PM, Edward Kmett wrote: > >> On Tue, May 3, 2011 at 3:43 PM, Yitzchak Gale wro

Re: [Haskell-cafe] Please add a method for optimized concat to the Semigroup class

2011-05-04 Thread Edward Kmett
On Wed, May 4, 2011 at 7:40 AM, John Lato wrote: > From: Edward Kmett >> >> >> On Tue, May 3, 2011 at 3:43 PM, Yitzchak Gale wrote: >> >> > I'm sure there are countless other natural examples of semigroups >> > in the wild, and that the

Re: [Haskell-cafe] Please add a method for optimized concat to the Semigroup class

2011-05-03 Thread Edward Kmett
On Tue, May 3, 2011 at 6:49 PM, Edward Kmett wrote: > On Tue, May 3, 2011 at 3:43 PM, Yitzchak Gale wrote: > >> Edward Kmett wrote: >> > sconcat :: [a] -> a -> a >> > with either the semantics you supplied or something like >> > sconcat = appEndo . m

Re: [Haskell-cafe] Please add a method for optimized concat to the Semigroup class

2011-05-03 Thread Edward Kmett
On Tue, May 3, 2011 at 3:43 PM, Yitzchak Gale wrote: > Edward Kmett wrote: > > sconcat :: [a] -> a -> a > > with either the semantics you supplied or something like > > sconcat = appEndo . mconcat . map diff > > > The sconcat we have been discussing is &g

Re: [Haskell-cafe] Please add a method for optimized concat to the Semigroup class

2011-05-03 Thread Edward Kmett
On Tue, May 3, 2011 at 7:12 AM, Yitzchak Gale wrote: > Hi Edward, > > Thanks much for the very useful semigroups > package. > > When using it in practice, it would be very useful > to have an analogue to the mconcat method of > Monoid. It has the obvious default implementation, > but allows for a

Re: [Haskell-cafe] Please add instance Semigroup Text

2011-05-03 Thread Edward Kmett
On Tue, May 3, 2011 at 12:04 PM, Bryan O'Sullivan wrote: > On Tue, May 3, 2011 at 8:00 AM, Yitzchak Gale wrote: > >> >> Could you please add a Semigroup instance for Text? >> > > I'd strongly recommend writing an instance for the text package's Builder > type instead. Vastly more efficient for no

Re: [Haskell-cafe] SoC / Cabal project proposal: specify Setup.hs dependencies

2011-03-29 Thread Edward Kmett
On Tue, Mar 29, 2011 at 1:26 PM, Rogan Creswick wrote: > I've been wanting to share code between cabal projects for some time, > and I finally had a chance to write up the rough idea as a simple > proposal. Here's the description, with links to the SoC trac and > reddit haskell_proposals pages.

Re: [Haskell-cafe] Uncertainty analysis library?

2011-03-22 Thread Edward Kmett
e link is outdated or that there are problems on patch-tag? >> >> -Carter >> >> On Mon, Mar 21, 2011 at 4:57 PM, Edward Kmett wrote: >> >>> >>> On Mon, Mar 21, 2011 at 2:42 PM, Edward Amsden wrote: >>> >>>> >>>> So I'm f

Re: [Haskell-cafe] Looking for feedback on my attempt at a tree construction edsl

2011-03-22 Thread Edward Kmett
If you add an instance of IsString to handle leaf construction you can get it down to "Fruits" +> do "Apple" "Mango" "Arbitrary" +> do "1" "..." But I also don't see the point of doing this in a monad. -Edward On Tue, Mar 22, 2011 at 1:15 PM, Yves Parès wrot

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

2011-03-22 Thread Edward Kmett
2011/3/22 Mario Blažević > > 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 > Alt

Re: [Haskell-cafe] Uncertainty analysis library?

2011-03-21 Thread Edward Kmett
because I commented out a pattern guard, and it looked like a misplaced haddock comment. I've pushed a new version of intervals to mollify hackage. It (or the old version) should cabal install just fine. -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Uncertainty analysis library?

2011-03-21 Thread Edward Kmett
On Sun, Mar 20, 2011 at 5:46 PM, Tom Nielsen wrote: > Interval arithmetic is of course not the same as uncertainty, although > computer scientists like to pretend that is the case. (and uncertainty > estimates do not have the be "rough".) > Very true. > In general the propagation of errors dep

Re: [Haskell-cafe] Uncertainty analysis library?

2011-03-20 Thread Edward Kmett
I have a package for interval arithmetic in hackage http://hackage.haskell.org/package/intervals-0.2.0 However it does not currently properly adjust the floating point rounding mode so containment isn't perfect. However, we are actively working on fixing up the Haskell MPFR bindings, which will

Re: [Haskell-cafe] How to use roots package?

2011-03-20 Thread Edward Kmett
If your function has nice derivatives, you may want to look at the Newton implementation in http://hackage.haskell.org/packages/archive/ad/0.44.4/doc/html/Numeric-AD-Newton.html#v:findZero or if you

[Haskell-cafe] [haskell-gsoc] Haskell.org Google Summer of Code 2011

2011-03-19 Thread Edward Kmett
freenode.net Thank you all very much and we look forward to another successful Summer of Code! -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] [Agda] Defining subtraction for naturals

2011-03-17 Thread Edward Kmett
On Thu, Mar 17, 2011 at 6:41 PM, wren ng thornton wrote: > On 3/17/11 5:12 PM, Conor McBride wrote: > >> On 17 Mar 2011, at 18:35, wren ng thornton wrote: >> >>> Another question on particulars. When dealing with natural numbers, we >>> run into the problem of defining subtraction. There are a fe

Re: [Haskell-cafe] How large is the Haskell community ?

2011-03-17 Thread Edward Kmett
Clearly we need some sort of xbox live -like achievement system for these. Achievement Unlocked: Stumped Oleg! On Sat, Feb 12, 2011 at 6:57 PM, Jan Christiansen < j...@informatik.uni-kiel.de> wrote: > > On 12.02.2011, at 21:18, Aaron Gray wrote: > > I was wondering if anyone had an idea or esti

Re: [Haskell-cafe] Custom monad using ST

2011-03-09 Thread Edward Kmett
On Wed, Mar 9, 2011 at 6:21 PM, Yves Parès wrote: > Well, I want to hide the fact that I'm using ST, so if I can hide the > existential type 's' it is better. > In practice if you want to actually _use_ ST you'll find you'll need to let the world escape into your type. Otherwise you won't be abl

Re: [Haskell-cafe] ANN: hmpfr-0.3.2 (requires integer-simple, supports mpfr 3.0.0)

2011-03-04 Thread Edward Kmett
code repository up to date? -Edward Kmett On Fri, Mar 4, 2011 at 3:27 PM, Daniel Peebles wrote: > According to Duncan Coutts (whom I asked about this issue in #ghc), the > solution here is to use the new foreign import prim machinery to talk to > MPFR. This prevents GC from occurring during the

Re: [Haskell-cafe] ANN: hmpfr-0.3.2 (requires integer-simple, supports mpfr 3.0.0)

2011-03-03 Thread Edward Kmett
that were blocked by this. -Edward Kmett 2011/3/3 Michal Konečný > Dear all, > > I am pleased to announce hmpfr-0.3.2, a new version of Aleš Bizjak's > bindings > to the MPFR arbitrary precision floating point arithmetic library. The > changes in this version are

Re: [Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library

2011-02-19 Thread Edward Kmett
On Sat, Feb 19, 2011 at 7:27 PM, Sterling Clover wrote: > On Sat, Feb 19, 2011 at 3:04 PM, Johan Tibell > wrote: > > On Sat, Feb 19, 2011 at 11:58 AM, Louis Wasserman > > wrote: > >> A couple thoughts: > >> size takes O(n). That's just depressing. Really. > > > > This applies to all the conta

Re: [Haskell-cafe] Instancing "Typeable" for monad transformers?

2011-02-01 Thread Edward Kmett
I would happily supply a patch to add the Typeable (and the few Data instances that can be made) to transformers. I had to make similar ones in my comonad-transformers package anyways. -Edward Kmett On Wed, Feb 2, 2011 at 1:02 AM, John Millikin wrote: > Is there any reasonable way to do t

Re: [Haskell-cafe] GPL License of H-Matrix and prelude numeric

2011-01-26 Thread Edward Kmett
atrix package, due to the licensing. He was very open to the idea of BSD licensing and to the idea of potentially factoring it apart into GPL and BSD packages if the GSL dependent portions could not be so licensed. The main reason this didn't happen is that this fell off my critical path a

Re: [Haskell-cafe] (Co/Contra)Functor and Comonad

2010-12-24 Thread Edward Kmett
+1 for adding a Contrafunctor/ContraFunctor to base somewhere. But I agree completely with Tony, please call it contramap. ;) Otherwise people will wonder why comonads are not cofunctors -- a matter which can be cleared up by avoiding sloppy terminology. +1 for adding Comonads. As an aside, since

Re: [Haskell-cafe] monoids and monads

2010-07-26 Thread Edward Kmett
> sort of property? > The types are not enough. What you need is the associativity of Kleisli arrow composition and the two identity laws. The three monad laws are precisely what you need to form this monoid. There are analogous laws for Applicative that serve the same purpose. -Edward Km

Re: [Haskell-cafe] Random this! ;-)

2010-07-26 Thread Edward Kmett
re general 'rollDice' funtion, which can give you an infinite list of random dice rolls. Trying to implement that function using the approach you used will lead to a computation that won't terminate. -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] cabal, Setup.lhs example

2010-07-23 Thread Edward Kmett
On Fri, Jul 23, 2010 at 8:07 AM, Edward Kmett wrote: > That actually runs contrary to one of cabal's other practices, which is to > add a 'simple' Setup.hs to your package as it makes the sdist is one is not > present. er.. I mean

Re: [Haskell-cafe] cabal, Setup.lhs example

2010-07-23 Thread Edward Kmett
you can execute runhaskell Setup.hs foo instead of cabal foo. You just need to tell cabal if you want to delegate to Setup.hs, by using something other than Simple as a build-type. The vast majority of the users of cabal never bother changing the behavior of Setup.hs. -Edward Kmett On Thu, Jul 22, 2

Re: [Haskell-cafe] Hot-Swap with Haskell

2010-07-16 Thread Edward Kmett
ation mechanism. That way hot-swapping the current process would leave your GUI (and the pipe/IPC mechanism) intact. You may then need to pass along whatever changes affect the gui over the pipe in a fairly manual fashion. -Edward Kmett On Thu, Jul 15, 2010 at 11:05 PM, Andy Stewart wrote: >

Re: new haskell project (Was Re: [Haskell-cafe] Subtype polymorphism in Haskell)

2010-07-10 Thread Edward Kmett
t; There are a number of places where it would be fairly trivial to improve upon the design of quantlib due to the ease of overloading and polymorphic instantiation in Haskell, e.g. dealing with portfolios that span multiple currencies, so take care with shackling yourself to the current design. -

Re: [Haskell-cafe] bug in ghci ?

2010-07-09 Thread Edward Kmett
a way that you can define any one combinator in turn of the others in a big long cycle. Foldable does this for instance in such a way that foldMap and foldr are defined cyclically. That's probably an interesting assertion that one of the category theorists > around here could prove or disprove. ;-) > I hope the above demonstrate that there are at least some fairly reasonable (and, given your request, appropriately category theoretic!) examples where one would want the ability to specify that there is more than one member of a minimal mutual definition. =) -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Transformers versus monadLib versus...

2010-07-09 Thread Edward Kmett
On Thu, Jul 8, 2010 at 12:37 PM, Yitzchak Gale wrote: > Hi Edward, > > Edward Kmett wrote: > > It looks like there is a fairly strong effort to fix most of the most > > egregious warts in the mtl. > > btw, does this overhaul include adding Applicative instances, >

Re: [Haskell-cafe] Memoization in Haskell?

2010-07-09 Thread Edward Kmett
bly a good idea to either filter the negative case like you do here, or, since it is well defined, extend the scope of the memo table to the full Int range by explicitly memoizing negative vales as well. -Edward Kmett On Fri, Jul 9, 2010 at 11:51 AM, Mike Dillon wrote: > begin Edward Kmett q

Re: [Haskell-cafe] Memoization in Haskell?

2010-07-09 Thread Edward Kmett
*Main> fastest_f 12380192300 67652175206 *Main> fastest_f 12793129379123 120695231674999 In fact it is so much faster that you can go through and replace Int with Integer above and get ridiculously large answers almost instantaneously *Main> fastest_f' 1

Re: [Haskell-cafe] Re: Transformers versus monadLib versus...

2010-07-06 Thread Edward Kmett
On Tue, Jul 6, 2010 at 10:01 PM, Ertugrul Soeylemez wrote: > Edward Kmett wrote: > > > You may want to review the thread here: > > > > http://www.haskell.org/pipermail/libraries/2009-November/012833.html > > > > The gist of it is, I would recommend stic

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

2010-07-06 Thread Edward Kmett
bo Haskell". While we're on the topic, does anyone else get funny looks when they say > "monads"? > Sadly, yes. ;) -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Transformers versus monadLib versus...

2010-07-06 Thread Edward Kmett
t so they can all link some day in the relatively near future without cabal flipping its lid. Of course, adding support for monadLib, which doesn't conflict with any of this is a completely concern. -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] How easy is it to hire Haskell programmers

2010-07-02 Thread Edward Kmett
, finger trees, stream fusion, purely functional data structures or ways to implement memoization in a purely functional setting, or how to abuse side effects to do so in a less pure way. Those are the kinds of things you get exposed to through actually

Re: [Haskell-cafe] Associated types

2010-07-01 Thread Edward Kmett
lace the constraint on > each > involved function. > > This much works. However equality constraints in the body still blow up at last check. -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Physical equality

2010-06-28 Thread Edward Kmett
is in IO to begin with. Typically you can construct something purely and inspect the result using IO all in one go, so the unsafePerformIO machinery isn't required. -Edward Kmett 2010/6/28 José Romildo Malaquias > Is there in Haskell a non monadic function of type a -> a -> Bool

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

2010-06-27 Thread Edward Kmett
On Sun, Jun 27, 2010 at 6:45 PM, Max Bolingbroke wrote: > On 27 June 2010 22:20, Edward Kmett wrote: > > I've pointed out the Codensity Set monad on the Haskell channel. > > I spend no time on #haskell but clearly I should :) > > > It is an > > interestin

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

2010-06-27 Thread Edward Kmett
ot sure if requiring no class constraints at > all is a good requirement. It only makes things more complicated, without > providing more insights. > > I'd say that if class X requires a superclass constraint Y, then the > instance of X (D d) is allowed to have the constraint Y d. The above code > then stays the same, only with Yoneda removed and constraints added. > This is an encoding of the fact that all Functors in Haskell are strong, and that Yoneda i is a Functor for any i :: * -> *. -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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

2010-06-27 Thread Edward Kmett
d all of your binds and associating them to the right. One way to think about how Codensity adjusts a monad is that it can take something that is almost a monad (you need to get in and out of Codensity). Another thing to note is that Codensity is slightly more powerful than the original type yo

Re: [Haskell-cafe] Manual Type-Checking to provide Read instances for GADTs. (was Re: [Haskell-cafe] Read instance for GATD)

2010-06-25 Thread Edward Kmett
I've obtained permission to repost Gershom's slides on how to deserialize GADTs by typechecking them yourself, which are actually a literate haskell source file, that he was rendering to slides. Consequently, I've just pasted the content below as a literate email. -Edward Kmett

Re: [Haskell-cafe] Read instance for GATD

2010-06-25 Thread Edward Kmett
c-phi this time around. I will check with him to see if I can get permission to host them somewhere and post a link to them here. -Edward Kmett On Fri, Jun 25, 2010 at 5:04 AM, wrote: > > Hello Haskellers, > > I'm having trouble writing a Read Instance for my GATD. > Arg

Re: [Haskell-cafe] Rewriting a famous library and using the same name: pros and cons

2010-06-23 Thread Edward Kmett
On Wed, Jun 23, 2010 at 2:57 PM, Gregory Crosswhite < gcr...@phys.washington.edu> wrote: > On 6/23/10 2:13 PM, Edward Kmett wrote: > > On Tue, Jun 22, 2010 at 4:54 PM, Gregory Crosswhite < > gcr...@phys.washington.edu> wrote: > >> There is no reason that your

Re: [Haskell-cafe] Rewriting a famous library and using the same name: pros and cons

2010-06-23 Thread Edward Kmett
the haskell platform and the new design will not be stable for some time If fgl wasn't part of the haskell platform or the changes were less radical, the balance of net good might go the other way. -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Huffman Codes in Haskell

2010-06-22 Thread Edward Kmett
hackage.haskell.org/packages/archive/monoids/0.1.36/doc/html/src/Data-Generator-Compressive-LZ78.html -Edward Kmett ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Rewriting a famous library and using the same name: pros and cons

2010-06-22 Thread Edward Kmett
re not the answer. -Edward Kmett On Tue, Jun 8, 2010 at 2:21 PM, Gregory Crosswhite < gcr...@phys.washington.edu> wrote: > Or you just put an upper bound on the versions of the fgl library that your > program will build against, as you should be doing anyway, and then nothing > b

Re: [Haskell-cafe] TH instance code.

2010-06-22 Thread Edward Kmett
v-- I had accidentally elided the _'s before the t's in the quasiquotation before. What you're looking for is something like: deriveVariable _t = [d| instance Variable $_t where toVariant = toVariant . show fromVariant x = fmap (\v -> read v :: $_t) $ fromVariant x|] deriveVa

  1   2   3   >