Re: [Haskell-cafe] Ratification for my understanding of functors

2011-01-08 Thread wren ng thornton
On 1/8/11 5:23 AM, C K Kashyap wrote: Hi, Thanks to Luke Palmer's explanation. I got a better idea of functors. I just want to ratify my understanding of what a functor is - according to category theory, functors are arrows between categories ... these arrows map objets and arrows from one

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

2010-12-24 Thread wren ng thornton
On 12/23/10 11:46 PM, Mario Blažević wrote: On Thu, Dec 23, 2010 at 11:25 PM, Tony Morristonymor...@gmail.com wrote: ...regardless of the utility of a contravariant functor type-class, I strongly advocate for calling it Contrafunctor and not Cofunctor. I have seen numerous examples of

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

2010-12-24 Thread wren ng thornton
On 12/24/10 12:26 AM, C. McCann wrote: As far as I understand (which may not actually be all that far), contravariant functors just go to or from an opposite category, a distinction that is purely a matter of definition, not anything intrinsic. Yes. On the other hand, Applicative and Monad

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

2010-12-24 Thread wren ng thornton
On 12/23/10 9:41 PM, Daniel Peebles wrote: For me, mostly naming. Cofunctor isn't the right name for it, and comap, while short, feels wrong. Contrafunctor feels better but is also cumbersome. No problems with Comonad, though. It is wrong. Cofunctors are exactly functors. It's unfortunate that

Re: [Haskell-cafe] Offer to mirror Hackage

2010-12-13 Thread wren ng thornton
On 12/13/10 8:25 AM, Paul Sargent wrote: How about, as a cheep and cheerful method to get up running. If the premise is that the original server is trustworthy and the mirrors aren't, then: 1) Hash all packages on the original server. 2) Hash goes into a side car file (e.g.packagename.sha) that

Re: [Haskell-cafe] Offer to mirror Hackage

2010-12-11 Thread wren ng thornton
On 12/9/10 4:04 PM, Richard O'Keefe wrote: On 10/12/2010, at 12:18 AM, Markus Läll wrote: My take on the issue is that we should make it possible to easily mirror hackage (what the OP asked for), so that people could use it when they wanted to, and have a list of the mirrors on the wiki.

Re: [Haskell-cafe] Offer to mirror Hackage

2010-12-11 Thread wren ng thornton
On 12/11/10 5:59 AM, wren ng thornton wrote: On 12/9/10 4:04 PM, Richard O'Keefe wrote: As long as the material from Y replicated at X is *supposed* to be publicly available, I don't see a security problem here. Only Y accepts updates from outside, and it continues to do whatever authentication

Re: [Haskell-cafe] Offer to mirror Hackage

2010-12-06 Thread wren ng thornton
On 12/6/10 2:35 AM, Vincent Hanquez wrote: I would really like mirrors too. But before that happens it would be nice to have signed packages on Hackage, preventing a mirror to distribute compromised stuff (intentionally or unintentionally). +1. This should be done during sdist, before

Re: [Haskell-cafe] need help with syntax...

2010-12-06 Thread wren ng thornton
On 12/6/10 7:26 PM, Daryoush Mehrtash wrote: I am having hard time understanding the following code. The code is from Applicative Parser library: http://hackage.haskell.org/packages/archive/uu-parsinglib/2.5.5.2/doc/html/src/Text-ParserCombinators-UU-BasicInstances.html instance (Show a,

Re: [Haskell-cafe] Offer to mirror Hackage

2010-12-05 Thread wren ng thornton
On 12/4/10 10:34 PM, wren ng thornton wrote: FWIW, I've been on the board of directors for a 501(c)(3), helped write their bylaws, and know a few people in the business (lawyers, etc). I'm willing to offer advice, effort, and references whenever the committee decides to do this. I tried cc-ing

Re: [Haskell-cafe] Offer to mirror Hackage

2010-12-05 Thread wren ng thornton
On 12/5/10 11:23 AM, Ketil Malde wrote: Florian Lengyelflorian.leng...@gmail.com writes: Why is there even any consideration of some committee if someone wants to mirror the Hackage site? Why not mirror the site? +1 Alright, Mr. Wiseguy, she said, if you're so clever, you tell us

Re: [Haskell-cafe] Offer to mirror Hackage

2010-12-04 Thread wren ng thornton
On 12/4/10 11:31 AM, Dan Knapp wrote: With Hackage down, now seemed like a good time to push this issue again. It's such an important site to us that it's really rather a shame there are no mirrors of it. I have a personal-and-business server in a data center in Newark, with a fair chunk of

Re: [Haskell-cafe] Offer to mirror Hackage

2010-12-04 Thread wren ng thornton
On 12/4/10 2:21 PM, Riad S. Wahby wrote: Ozgur Akgunozgurak...@gmail.com wrote: This is a very generous offer. However, I must say I like the following idea more: http://www.reddit.com/r/haskell/comments/efw38/ reminder_hackagehaskellorg_outage_tomorrow_due_to/c17u7nk That sounds like a

Re: [Haskell-cafe] Categorical description of systems with dependent types

2010-12-03 Thread wren ng thornton
On 12/2/10 4:47 PM, Iavor Diatchki wrote: Hi, You have it exactly right, and I don't think that there's a particularly deep reason to prefer the one over the other. It seems that computer science people tend to go with the (product-function) terminology, while math people seem to prefer the

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 did: Wed Jan 27 11

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 thorntonw...@freegeek.org 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

Re: [Haskell-cafe] Transparent identity instances

2010-11-28 Thread wren ng thornton
On 11/28/10 9:59 AM, Jafet wrote: But GHC does not accept type synonym instances unless they are fully applied. That's precisely the problem, and why a newtype is used. More than GHC implementation details, there's the deeper problem that allowing general type-level functions causes

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.,

Re: [Haskell-cafe] Musings on type systems

2010-11-21 Thread wren ng thornton
On 11/20/10 6:33 AM, Ketil Malde wrote: Andrew Coppinandrewcop...@btinternet.com writes: Now here's an interesting thought. Haskell has algebraic data types. Algebraic because they are sum types of product types (or, equivilently, product types of sum types). Now I don't actually know what

Re: [Haskell-cafe] doesDirectoryExist is always returning False

2010-11-21 Thread wren ng thornton
On 11/20/10 9:55 AM, Marcelo Sousa wrote: Hi, I'm having currently a problem with System.Directory in my mac os. System Version: Mac OS X 10.6.5 Kernel Version: Darwin 10.5.0 Prelude System.Directory let dirTest = do {dir- getCurrentDirectory; doesDirectoryExist dir} Prelude

Re: [Haskell-cafe] Musings on type systems

2010-11-19 Thread wren ng thornton
On 11/19/10 4:05 PM, Andrew Coppin wrote: So what would happen if some crazy person decided to make the kind system more like the type system? Or make the type system more like the value system? Do we end up with another layer to our cake? Is it possible to generalise it to an infinite number of

Re: [Haskell-cafe] Musings on type systems

2010-11-19 Thread wren ng thornton
On 11/19/10 10:05 PM, Ryan Ingram wrote: On Fri, Nov 19, 2010 at 1:05 PM, Andrew Coppin wrote: So is Either what is meant by a sum type? Similarly, (X, Y) [...] is this a product type? Yes and no. Unfortunately there's some discrepancy in the terminology depending on who you ask. In the

Re: [Haskell-cafe] Musings on type systems

2010-11-19 Thread wren ng thornton
On 11/19/10 10:05 PM, Ryan Ingram wrote: Not exactly; in the phantom type case, the two sets ARE disjoint in a way; there are no objects that are both Foo Int and Foo Bool (although there may be objects of type forall a. Foo a -- more on that later). Whereas the type keyword really creates two

Re: [Haskell-cafe] Re: ANNOUNCE zeno 0.1.0

2010-11-16 Thread wren ng thornton
On 11/13/10 8:15 AM, Will Sonnex wrote: Infinite values (lazy-evaluation in general) also give Zeno a problem, since you can no longer use structure as a well-defined ordering for induction. A property such as reverse (reverse xs) === xs does not work for infinite lists, since you can

Re: [Haskell-cafe] Splittable random numbers

2010-11-12 Thread wren ng thornton
On 11/12/10 5:33 AM, Richard Senington wrote: It does not give the results you would want. This may have something to do with picking good parameters for the mkLehmerTree function. For example, using a random setup, I just got these results result expected range 16.814 expected = 16.0 (1,31)

Re: [Haskell-cafe] an evil type hangs GHC

2010-11-12 Thread wren ng thornton
On 11/12/10 4:53 PM, Ryan Ingram wrote: From http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/bugs.html#bugs-ghc: GHC's inliner can be persuaded into non-termination using the standard way to encode recursion via a data type: More specifically, since your bad2 does not look recursive,

Re: [Haskell-cafe] RegEx versus (Parsec, TagSoup, others...)

2010-11-12 Thread wren ng thornton
On 11/12/10 6:56 PM, Michael Litchard wrote: I've been working on a project that requires me to do screen scraping. When I first started this, I worked off of other people's examples. Not one used regex. By luck I found someone at work to help me along this project. His clues and hints don't use

Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-11 Thread wren ng thornton
On 11/11/10 8:54 PM, Richard O'Keefe wrote: I remind readers once again that in SML record selectors *don't* clash with names of functions. I am not concerned here to argue either for or against SML-style records and their selectors, only to point out that wanting *record fields* whose

Re: [Haskell-cafe] Type Directed Name Resolution

2010-11-10 Thread wren ng thornton
On 11/10/10 4:59 PM, Dan Doel wrote: I'll admit, the Agda overloading is handy. But I've always considered Haskell's lack of ad-hoc overloading to be a feature. Type classes give sensible types for what would normally be ad-hoc. Adding back ad-hoc functions that have no available general type

Re: [Haskell-cafe] Fwd: Questions about lambda calculus

2010-11-10 Thread wren ng thornton
On 11/10/10 9:18 AM, Max Bolingbroke wrote: On 10 November 2010 12:49, Patrick LeBoutillier wrote: I'm a total newbie with respect to the lambda calculus. I tried (naively) to port these examples to Haskell to play a bit with them: You can give type signatures to your first definitions like

Re: [Haskell-cafe] Compiler constraints in cabal

2010-11-07 Thread wren ng thornton
On 11/7/10 11:54 AM, Henning Thielemann wrote: Awful - I would not like to complicate my Cabal files this way. This is like copying the Build-Depends enumeration to all depending packages. Oh, I agree :) I wonder if you can include ghc in the build-tools: field and whether cabal-install

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-11-06 Thread wren ng thornton
On 11/5/10 7:54 AM, Alexey Khudyakov wrote: We already know that there are noncommutative modules/vectorspaces of interest (e.g., modules over quaternions and modules over graph paths), why not support them from the beginning? It seems like you're going out of your way to exclude things that

Re: [Haskell-cafe] What do you call Applicative Functor Morphism?

2010-11-06 Thread wren ng thornton
On 11/6/10 2:09 AM, Sebastian Fischer wrote: Hello, I'm curious and go a bit off topic triggered by your statement: On Nov 6, 2010, at 12:49 PM, rocon...@theorem.ca wrote: An applicative functor morphism is a polymorphic function, eta : forall a. A1 a - A2 a between two applicative functors

Re: [Haskell-cafe] Compiler constraints in cabal

2010-11-06 Thread wren ng thornton
On 11/6/10 3:13 AM, Ivan Lazar Miljenovic wrote: On 6 November 2010 17:52, Reiner Popereiner.p...@gmail.com wrote: Ah, I hadn't thought of that. But doesn't the version of GHC change much more often than the version of base does? Each major version of GHC has a different (major) version of

Re: [Haskell-cafe] Compiler constraints in cabal

2010-11-06 Thread wren ng thornton
On 11/6/10 6:20 AM, Reiner Pope wrote: I was aware of this condition, but I'm not precisely sure it addresses my requirements. When you run cabal install some-package, cabal reads all version constraints listed in the build-depends field, and chooses which versions of which packages to download

Re: [Haskell-cafe] Is Curry alive?

2010-11-05 Thread wren ng thornton
On 11/4/10 6:32 PM, Gregory Crosswhite wrote: On 11/04/2010 03:06 PM, Dan Doel wrote: Implementing type inference can be very easy in a logic language, because most of the work in a non-logic language is implementing unification: [...] Cool! Thank you very much; that is exactly the kind of

Re: [Haskell-cafe] Is Curry alive?

2010-11-03 Thread wren ng thornton
On 11/3/10 12:34 AM, Gregory Crosswhite wrote: On 11/2/10 8:37 PM, wren ng thornton wrote: Though I would suggest you look at the LogicT library instead of using actual lists... Also, you may be interested in reading the LogicT paper[2] or this paper[3] about search combinators in Haskell. Both

Re: [Haskell-cafe] Mysterious fact

2010-11-02 Thread wren ng thornton
On 11/1/10 6:28 PM, Andrew Coppin wrote: The other day, I accidentally came up with this: |{-# LANGUAGE RankNTypes #-} type Either x y= forall r. (x - r) - (y - r) - r left :: x - Either x y left x f g= f x right :: y - Either x y right y f g= g y | This is one example; it seems that just

Re: [Haskell-cafe] Is Curry alive?

2010-11-02 Thread wren ng thornton
On 11/2/10 7:09 AM, Sebastian Fischer wrote: On Nov 2, 2010, at 9:27 AM, Gregory Crosswhite wrote: Which does raise the question: when is it better to use a logic programming language instead of the list monad? It is more cumbersome to model logic variables and unification in a pure

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-31 Thread wren ng thornton
On 10/31/10 6:36 PM, Alexey Khudyakov wrote: On Wed, Oct 27, 2010 at 2:53 AM, wren ng thornton wrote: Is there any good reason for forcing them together? Why not, use the hierarchy I proposed earlier? [...] Main reason is that it complicate creation of instances for types for which

Re: [Haskell-cafe] Reference for technique wanted

2010-10-31 Thread wren ng thornton
On 10/31/10 7:10 PM, Derek Elkins wrote: Well, you can get A Novel Representation of Lists and Its Application to the Function 'Reverse' by John Hughes online published in 1986 which is referenced by Wadler's 1987 The Concatenate Vanishes and references Richard Bird's 1984 paper Transformational

Re: [Haskell-cafe] Reference for technique wanted

2010-10-31 Thread wren ng thornton
On 10/31/10 10:26 PM, Richard O'Keefe wrote: On 1/11/2010, at 2:02 PM, wren ng thornton wrote: (Though I find it curious that you think the logic version is so different...) The logic programming version uses a SINGLE data structure for lists and differences, so that + converting from

Re: [Haskell-cafe] who's in charge?

2010-10-29 Thread wren ng thornton
On 10/29/10 2:33 AM, Gregory Crosswhite wrote: Also, this is a complete aside but what the heck. :-) Has anyone else been driven crazy by the way that Java code and libraries are documented? It seems like whenever I try to figure out how to use a piece of Java code, the functionality is spread

Re: [Haskell-cafe] Re: Current thinking on CompositionAsDot issue in haskell prime?

2010-10-29 Thread wren ng thornton
On 10/29/10 11:18 AM, Daniel Peebles wrote: Speaking of MagicHash, is it really necessary to take an operator with potential like (#) just to keep primitive symbols separate from the rest? At least from my 2010 Haskell learner perspective, it seems odd to create a whole language

Re: [Haskell-cafe] Re: Current thinking on CompositionAsDot issue in haskell prime?

2010-10-29 Thread wren ng thornton
On 10/29/10 8:33 PM, C. McCann wrote: On Fri, Oct 29, 2010 at 7:54 PM, wren ng thorntonw...@freegeek.org wrote: I'm sort of torn on this issue. On the one hand (#) has great potential as an operator, on the other hand I've found that having something like -XMagicHash (or TeX's \makeatletter

Re: [Haskell-cafe] Re: Current thinking on CompositionAsDot issue in haskell prime?

2010-10-28 Thread wren ng thornton
On 10/28/10 10:42 AM, Ben Millwood wrote: Here's the wiki page: http://hackage.haskell.org/trac/haskell-prime/wiki/CompositionAsDot Personally I think function composition is what Haskell is all about and it is absolutely essential that the syntax for it be lightweight. If we think using . as

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-26 Thread wren ng thornton
On 10/26/10 8:51 AM, Alexey Khudyakov wrote: On 24.10.2010 03:38, wren ng thornton wrote: I don't care much about the name of the class, I'd just like support for monoids, semirings,... when they lack a group, ring,... structure. Then what about following type class hierarchy? I think

Re: [Haskell-cafe] ANNOUNCE: iteratee-compress 0.1.1

2010-10-24 Thread wren ng thornton
On 10/24/10 7:09 AM, Maciej Piechotka wrote: Iteratee-compress provides compressing and decompressing enumerators including flushing. Currently only gzip is provided but at least bzip is planned. Changes from previous version: - Independent from zlib library (Haskell one, not C) - Allow

Re: [Haskell-cafe] Re: ANNOUNCE: iteratee-compress 0.1.1

2010-10-24 Thread wren ng thornton
On 10/24/10 8:14 PM, Felipe Lessa wrote: On Sun, Oct 24, 2010 at 9:59 PM, Maciej Piechotkauzytkown...@gmail.com wrote: Currently I thought only about bzip2/gzip. Probably .xz support would follow if any. LZO, as you said, is on GPL-2. While I have no problems with GPL-2 some potential users

Re: [Haskell-cafe] concurrency vs. I/O in GHC

2010-10-23 Thread wren ng thornton
On 10/23/10 2:33 PM, Brandon S Allbery KF8NH wrote: I think they mean please don't conflate `reentrant' with `blocking' in the FFI. Not knowing much about the guts of GHC's implementation of the FFI, I wonder if there would actually be an implementational difference in distinguishing

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread wren ng thornton
On 10/23/10 4:53 PM, Alexey Khudyakov wrote: On 23.10.2010 05:11, wren ng thornton wrote: I'd rather see, class Additive v where -- or AdditiveMonoid, if preferred zeroV :: v (^+^) :: v - v - v class Additive v = AdditiveGroup v where negateV :: v - v Seems good for me. One more instance

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread wren ng thornton
On 10/23/10 5:19 PM, Daniel Peebles wrote: Just out of curiosity, why do you (and many others I've seen with similar proposals) talk about additive monoids? are they somehow fundamentally different from multiplicative monoids? Or is it just a matter of notation? When I was playing with building

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-23 Thread wren ng thornton
On 10/23/10 7:52 PM, wren ng thornton wrote: I'd argue that neither usage is primary, and therefore the best solution is actually to have three classes (neutral, additive, and multiplicative) with two functors (additive-neutral, multiplicative-neutral) to connect them[1].[...] [1] the Exp/Log

Re: [Haskell-cafe] Haskell Weekly News: Issue 155 - October 20, 2010

2010-10-22 Thread wren ng thornton
On 10/21/10 5:38 AM, Ketil Malde wrote: I'm always getting two copies of everything in haskell@, since everything is cross-posted to -cafe. Are there actually people subscribed to -cafe, but *not* to hask...@? And if so, why? I am. In part because I don't want to get two copies of

Re: [Haskell-cafe] Haskellers design

2010-10-22 Thread wren ng thornton
On 10/21/10 2:32 PM, Christopher Done wrote: [1] http://imgur.com/lnkE7.png [2] http://previasports.com/haskellers_website/ I like the colour theme of the former and the layout of the latter. The colour theme of the first is more professional, I think. I vote that styles should be consistent.

Re: [Haskell-cafe] vector-space and standard API for vectors

2010-10-22 Thread wren ng thornton
On 10/22/10 8:46 AM, Alexey Khudyakov wrote: Hello everyone! It's well known that Num Co type classes are not adequate for vectors (I don't mean arrays). I have an idea how to address this problem. Conal Elliott wrote very nice set of type classes for vectors. (Definition below). I used them

Re: [Haskell-cafe] Haskellers.com skills list moderation?

2010-10-20 Thread wren ng thornton
On 10/20/10 9:12 AM, Anthony Cowley wrote: We don't want people outside of an area of interest governing name choices that lessen the value of the tags. To be honest, when the thread first came up, I was afraid NLP (or AG) would end up on the cutting block because of that... As a strawman

Re: [Haskell-cafe] Are newtypes optimised and how much?

2010-10-20 Thread wren ng thornton
On 10/20/10 7:09 AM, Simon Peyton-Jones wrote: Yes, you can freely use Foo/unFoo. There's no runtime penalty. (In the jargon of GHC's intermediate language, Foo and unFoo translate to *type-safe casts*, which generate no executable code. When does the conversion to type-safe casts occur

Re: [Haskell-cafe] Why isn't there a cheaper split-in-two operation for Data.Set?

2010-10-19 Thread wren ng thornton
On 10/19/10 5:47 AM, Ryan Newton wrote: That sounds good to me. In any case the parallel map/fold operations by themselves shouldn't compromise the abstraction. Perhaps an eventual solution would be to start including parallel maps/folds right inside the standard libraries. I haven't began

Re: [Haskell-cafe] Haskellers.com skills list moderation?

2010-10-19 Thread wren ng thornton
On 10/19/10 9:32 AM, Michael Snoyman wrote: There are 11 skills I'm leaning towards dropping, all because they fall in the too vague/too general category. Your input is requested on these. They are: Attribute Grammar Categorical Programming Denotational design Proving observational equivalence

Re: [Haskell-cafe] Are newtypes optimised and how much?

2010-10-19 Thread wren ng thornton
On 10/19/10 2:12 PM, Christopher Done wrote: Questions (I'm talking about GHC when I refer to compilation): (1) Are fromString and fromIntegral ran at compile time? I don't think that this is the case. I think they are just translated to fromString Hello, World! and fromIntegral 2 verbatim. (2)

Re: [Haskell-cafe] Re: A rant against the blurb on the Haskell front page

2010-10-16 Thread wren ng thornton
On 10/16/10 10:48 AM, Ben Franksen wrote: Don Stewart wrote: It is open source, and was born open source. It is the product of research. How can a language be open source, or rather, how can it *not* be open source? The point of a (programming) language is that it has a published ('open')

Re: [Haskell-cafe] Re: A rant against the blurb on the Haskell front page

2010-10-16 Thread wren ng thornton
On 10/16/10 11:34 AM, Ben Franksen wrote: Christopher Done wrote: To solve this ambiguity that phrase is a link that people can click to find out what it means. Object oriented, dynamically typed, stack-based are about as meaningful. The difference may be that everyone thinks he knows what

Re: [Haskell-cafe] Re: A rant against the blurb on the Haskell front page

2010-10-16 Thread wren ng thornton
On 10/16/10 11:22 AM, Ben Franksen wrote: Much better. Though I *do* think mentioning the main implementations and their qualities is a good thing to o, right after this: [...]The most important Haskell implementation, ghc [like to ghc page], has served as a test bed for practical application

Re: [Haskell-cafe] Systematic treatment of static arguments

2010-10-16 Thread wren ng thornton
On 10/16/10 3:39 PM, Stephen Tetley wrote: Hello list The Monad and Applicative instances for functions are equivalent to the respective Reader vesions (I use equivalent along the lines of - operationally the same but without the type distinction / newtype). There is also the Monoid instance

Re: [Haskell-cafe] An interesting paper from Google

2010-10-16 Thread wren ng thornton
On 10/16/10 8:25 PM, Dan Doel wrote: On Saturday 16 October 2010 7:04:23 pm Ben Millwood wrote: On Fri, Oct 15, 2010 at 9:28 PM, Andrew Coppin wrote: I'm still quite surprised that there's no tool anywhere which will trivially print out the reduction sequence for executing an expression.

Re: [Haskell-cafe] Layered maps

2010-10-10 Thread wren ng thornton
On 10/9/10 2:02 AM, Alex Rozenshteyn wrote: This came up as I was doing homework for natural language processing. I'm constructing a trigram model from training data, but I also need the bigram and unigram counts. I could, for each triple of characters, add the 3 tuple to a trigram map and

Re: [Haskell-cafe] Re: Re-order type (flip map)

2010-10-10 Thread wren ng thornton
On 10/10/10 7:00 PM, Johannes Waldmann wrote: My point was: you need to find/define two operators, not just one. Sure, I need flip ($) and flip (.) Since the Prelude forgot to define these (and flip map), the question was: are there established names for these two operators? I don't

Re: [Haskell-cafe] Ordering vs. Order

2010-10-08 Thread wren ng thornton
On 10/7/10 8:35 AM, Ketil Malde wrote: Christian Sternagelc.sterna...@gmail.com writes: recently I was wondering about the two words order and ordering I would use ordering to mean the relation or function that orders (ranks) elements, and I'd use order to refer the actual progression. So by

Re: [Haskell-cafe] Layered maps

2010-10-08 Thread wren ng thornton
On 10/8/10 5:46 PM, Thomas DuBuisson wrote: Alex, The containers library can do this already - there are no constraints on the elements of a Map. For example: type TripleNestedMap a = Map Int (Map Char (Map String a)) But this is rather silly as you can just do: type MapOfTriples a = Map

Re: [Haskell-cafe] Suggestions for improvement

2010-10-03 Thread wren ng thornton
On 10/3/10 5:52 PM, Victor Nazarov wrote: I suggest to pay more attention to haskell's standard library. allButLast is called init in Data.List module. Second, do not use explicit recursion. You can capture recursion using some high-order function like map, filter, foldr and so on:

Re: [Haskell-cafe] Lambda-case / lambda-if

2010-10-02 Thread wren ng thornton
On 10/2/10 3:13 PM, Christopher Done wrote: There's nothing more annoying than having to introduce intermediate bindings when you're going to immediate pattern match against it immediately and never use it again. It's both annoying to have to think of a variable name that makes sense and is not

Re: [Haskell-cafe] Simple question about the function composition operator

2010-09-25 Thread wren ng thornton
On 9/24/10 5:35 AM, Axel Benz wrote: Can anybody explain why this happens and how I can compose f and g? Hint: It works fine if f is defined as an unary function. As already mentioned: (g . f) x y = (\z- g (f z)) x y = g (f x) y In order to get it to work you need to say that you want to

Re: [Haskell-cafe] Re: Shared thunk optimization. Looking to solidify my understanding

2010-09-25 Thread wren ng thornton
was what I was pointing out in in the post described as: On Wed, Sep 22, 2010 at 11:10 AM, David Sankelcam...@gmail.com wrote: wren ng thornton provided an evaluation using another operational semantics (reference?). Under this semantics, this optimization would be called partial evaluation

Re: [Haskell-cafe] Applicative instances for Monads

2010-09-25 Thread wren ng thornton
On 9/24/10 10:01 PM, Gregory Crosswhite wrote: Hey everyone, There is something that has been bugging me recently about the Applicative class and the Monad class. Any type constructor F that is a Monad has a natural Applicative instance, ($) :: F (a - b) - F a - F b mf $ ma = do f - mf a - ma

Re: [Haskell-cafe] Shared thunk optimization. Looking to solidify my understanding

2010-09-22 Thread wren ng thornton
On 9/22/10 11:48 AM, Daniel Fischer wrote: On Wednesday 22 September 2010 17:10:06, David Sankel wrote: The following code (full code available here[1], example taken from comments here[2]), const' = \a _ - a test1 c = let a = const' (nthPrime 10) in (a c, a c) test2 c = let

Re: [Haskell-cafe] Re: Re: Re: Full strict functor by abusing Haskell exceptions

2010-09-18 Thread wren ng thornton
On 9/18/10 8:00 AM, Sjoerd Visscher wrote: On Sep 17, 2010, at 10:39 PM, Ben Franksen wrote: What I actually wanted was a mathematical definition, though. Here's a definition of pointed objects: http://ncatlab.org/nlab/show/pointed+object pointed objects, pointed sets/groups/topospaces,

Re: [Haskell-cafe] Re: Re: Do expression definition

2010-09-17 Thread wren ng thornton
On 9/16/10 4:59 PM, Ben Franksen wrote: wren ng thornton wrote: The difference is that, for let-bindings, once you've figured out a type of the variable being bound, then that type can be generalized. [...] Whereas, lambda-bindings don't get generalized, and so they'll always be monomorphic

Re: [Haskell-cafe] Re: Re: Re: Full strict functor by abusing Haskell exceptions

2010-09-17 Thread wren ng thornton
On 9/17/10 4:39 PM, Ben Franksen wrote: Thanks for the link. What I actually wanted was a mathematical definition, though. From the TMR article I gather that a pointed functor could be defined as an endo-functor F: C - C together with a natural transformation pure: Id - F where Id: C

Re: [Haskell-cafe] example in All about Monads

2010-09-17 Thread wren ng thornton
On 9/17/10 12:48 PM, ender wrote: my question is, why not define the function father and mother as type of father::Maybe Sheep - Maybe Sheep? this can also clean the code and it avoid the additional function comb Do note that `comb` is giving you a natural way of creating those functions:

Re: [Haskell-cafe] Re: Re: Re: Do expression definition

2010-09-17 Thread wren ng thornton
On 9/17/10 4:04 PM, Ben Franksen wrote: wren ng thornton wrote: Note that when compilers do CPS conversion, everything is converted into let-binding and continuations (i.e., longjump/goto with value passing). It's just dual to the everything-is-lambda world, nothing special. Do you know

Re: [Haskell-cafe] Re: Scraping boilerplate deriving?

2010-09-15 Thread wren ng thornton
On 9/15/10 9:11 AM, Kevin Jardine wrote: Hi Malcolm, In this case, I am counting on GHC's {-# LANGUAGE GeneralizedNewtypeDeriving #-} feature to derive the instances for the classes I am including in the deriving clause. So perhaps portability is not a big issue here in any case. Yes, but

Re: [Haskell-cafe] Memoization/call-by-need

2010-09-15 Thread wren ng thornton
On 9/15/10 10:39 PM, Conal Elliott wrote: Hi Alex, In Haskell, data structures cache, while functions do not. Exactly. What this means is that when you call (slowFib 50) Haskell does not alter slowFib in any way to track that it maps 50 to $whatever; however, it does track that that

Re: [Haskell-cafe] Re: Do expression definition

2010-09-15 Thread wren ng thornton
On 9/13/10 6:22 AM, Michael Lazarev wrote: Thanks for examples and pointers. Since I came from Lisp, it never occurred to me that let and lambda are different constructs in Haskell. I thought that let x = y in f is really (\x - f) y It turns out that let is about declarations which

Re: [Haskell-cafe] Re: Full strict functor by abusing Haskell exceptions

2010-09-15 Thread wren ng thornton
On 9/13/10 6:23 PM, Paolo G. Giarrusso wrote: Then, I would also like to understand what exactly a strict functor is, in detail, and/or a link to the post you reference. I'm assuming the OP was referring to a functor for strictness I mentioned recently in the discussion about pointed

Re: [Haskell-cafe] A new cabal odissey: cabal-1.8 breaking its own neck by updating its dependencies

2010-09-11 Thread wren ng thornton
On 9/11/10 3:43 PM, Daniel Fischer wrote: - is there a specification of which are the core packages? core as in *do not update*? Basically, what comes with GHC shouldn't be updated. Though I heard updating Cabal was okay. I tried updating Cabal once (recently) and it broke things in the same

Re: [Haskell-cafe] Restricted type classes

2010-09-10 Thread wren ng thornton
On 9/10/10 12:47 AM, David Menendez wrote: It seems like you could use a similar argument to show that fmap id /= id. Specifically, xs and map id xs are equivalent lists, but they occupy different locations in memory. By replacing xs with map id xs, you can come arbitrarily close to doubling a

Re: [Haskell-cafe] Restricted type classes

2010-09-09 Thread wren ng thornton
On 9/9/10 1:04 AM, David Menendez wrote: Fascinating. I figured there might be a counter-example involving seq, but this is pretty subtle. In particular, would it be fair to say that in Haskell-without-seq, E (f a) a and E (f a) (f a) are indistinguishable? Yes, I think that without

Re: [Haskell-cafe] Restricted type classes

2010-09-08 Thread wren ng thornton
On 9/7/10 12:33 AM, Ivan Lazar Miljenovic wrote: On 7 September 2010 14:24, wren ng thorntonw...@freegeek.org wrote: On 9/7/10 12:04 AM, Ivan Lazar Miljenovic wrote: Not quite sure what you mean by a mis-match Just that they're not the same thing. For example, ZipList supports pure but it

Re: [Haskell-cafe] Restricted type classes

2010-09-08 Thread wren ng thornton
On 9/7/10 7:26 AM, Neil Brown wrote: On 07/09/10 05:24, wren ng thornton wrote: Just that they're not the same thing. For example, ZipList supports pure but it has no meaningful instance of singleton since every ZipList is infinite. I don't believe that every ZipList is infinite

Re: [Haskell-cafe] Restricted type classes

2010-09-08 Thread wren ng thornton
On 9/7/10 4:21 AM, Daniel Fischer wrote: On Tuesday 07 September 2010 05:22:55, David Menendez wrote: In fact, I think *every* appropriately-typed function satisfies that law. Does anyone know of a counter-example? -- | Multiply the *Hask* category by its number of objects. data E a

Re: [Haskell-cafe] Handling platform- or configuration-specific code (or, my CPP complaints)

2010-09-08 Thread wren ng thornton
On 9/7/10 3:10 PM, Ben Millwood wrote: So I wonder what people think of the use of CPP in Haskell code, what alternatives people can propose, or what people hope to see in future to make conditional compilation of Haskell code more elegant and simple? The only thing I ever use CPP for in

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread wren ng thornton
On 9/5/10 10:19 AM, Ivan Lazar Miljenovic wrote: Hmmm is there any reason for Functor to be a superclass of Pointed? I understand Functor and Pointed being superclasses of Applicative (which in turn is a superclass of Monad), but can't see any relation between Pointed and Functor...

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread wren ng thornton
On 9/6/10 2:35 AM, Ivan Lazar Miljenovic wrote: Well, if we consider what this does, pure is equivalent to singleton for container types. The actual definition of pure (or any other aspect of Pointed) doesn't require Functor; however there are properties for types that are instances of Functor

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread wren ng thornton
On 9/6/10 1:33 PM, David Menendez wrote: For that matter, can you even describe what pure is intended to do without reference to* or join? As already stated: fmap f . pure = pure . f -- Live well, ~wren ___ Haskell-Cafe mailing list

[Haskell-cafe] Pointed (was: Re: Restricted type classes)

2010-09-06 Thread wren ng thornton
On 9/6/10 11:50 AM, Gábor Lehel wrote: On Mon, Sep 6, 2010 at 5:11 PM, John Latojwl...@gmail.com wrote: But please don't make Pointed depend on Functor - we've already seen that it won't work for Bloom filters. I think most people have been using Pointed merely as shorthand for Pointed

Re: [Haskell-cafe] container-classes (was: Restricted type classes)

2010-09-06 Thread wren ng thornton
On 9/6/10 12:53 PM, John Lato wrote: I'd like to make one more argument in favor of my preference for more splitting of type classes. FWIW, I agree that more splitting is generally good. This is one of the problems I have with the various proposals for a ListLike class. They conflate the

Re: [Haskell-cafe] container-classes

2010-09-06 Thread wren ng thornton
On 9/6/10 11:46 PM, Ivan Lazar Miljenovic wrote: Well, my current work is to implement restricted versions of the various type classes (I'm undecided if they should be split off into a separate package or not) and then have the Data.Containers module basically define type aliases (which will

Re: [Haskell-cafe] Restricted type classes

2010-09-06 Thread wren ng thornton
On 9/7/10 12:04 AM, Ivan Lazar Miljenovic wrote: Perhaps this just means that union/insert should be part of some other class. That is part of the plan (I'm tentatively calling the class with the insert method Buildable or Extendable); this means that if a type is an instance of Monoid (for

Re: [Haskell-cafe] Restricted type classes

2010-09-04 Thread wren ng thornton
On 9/3/10 12:16 AM, Ivan Lazar Miljenovic wrote: 1) How should I name the kind * versions? For example, the kind * version of Functor is currently called Mappable with a class method of rigidMap. What should I call the kind * version of Foldable and its corresponding methods? Is there a valid

<    1   2   3   4   5   6   7   8   9   10   >