Re: [Haskell-cafe] is there some book about haskell and data struct and alg?

2008-05-31 Thread Robert Dockins
[snip] Without the equivalent Haskell source code, the code must be manually translated from Standard ML into Haskell. Does anybody know why the link is broken, when it may be fixed, and from where the Haskell source code can be currently obtained? Benjamin L. Russell If you are

Re: [Haskell-cafe] Longest increasing subsequence

2008-04-10 Thread Robert Dockins
On Thursday 10 April 2008 01:20:49 pm Matt Amos wrote: I'm trying to break out of my imperative mind-set by learning Haskell in small snippets. After a few successes I've hit a bit of a roadblock with one of the classic dynamic programming problems, the longest increasing subsequence:

Re: [Haskell-cafe] Re: (flawed?) benchmark : sort

2008-03-13 Thread Robert Dockins
On Thursday 13 March 2008 07:33:12 pm Aaron Denney wrote: [snip] I've seen mention of difficulties with Data.Map, and edison, but not in enough detail to really grasp what the problems are. Until I do, my natural bias (which I'm trying to resist, really) is that it's a matter of lazy coding,

Re: [Haskell-cafe] Doubting Haskell

2008-02-16 Thread Robert Dockins
I'm going to try to respond the the main practical question in this message; perhaps others will feel up to addressing the more philosophical aspects. (I see now that Cale has beaten me to the punch, but I guess I'll post this anyways...) Greetings Haskellers, [snip quite a bit of discussion]

Re: [Haskell-cafe] Collections library

2007-11-28 Thread Robert Dockins
[snip] I recently withdrew from this project and offered up the libs I'd been working on as they are for a new owner. Didn't get any takers though (no surprises there!). I've always found the lack of apparent interest in all this somewhat puzzling myself. It's not as if there's no latent

Re: [Haskell-cafe] Type without a data constructor?

2007-08-06 Thread Robert Dockins
On Monday 06 August 2007 19:23, Rahul Kapoor wrote: Most examples for defining algebraic types include data constructors like so: data Tree a = Tip | Node a (Tree a) (Tree a) I by mistake defined a type which did not specify a data constructor : In this example, you have two different uses

Re: [Haskell-cafe] Re: Can we do better than duplicate APIs? [was: Data.CompactString 0.3]

2007-03-28 Thread Robert Dockins
On Mar 28, 2007, at 2:44 PM, Benjamin Franksen wrote: Robert Dockins wrote: After taking a look at the Haddock docs, I was impressed by the amount of repetition in the APIs. Not ony does Data.CompactString duplicate the whole Data.ByteString interface (~100 functions, adding some more

Re: [Haskell-cafe] Re: Can we do better than duplicate APIs?

2007-03-28 Thread Robert Dockins
On Wednesday 28 March 2007 17:08, Benjamin Franksen wrote: Robert Dockins wrote: Some sort of in-langauge or extra-language support for mechanicly producing the source files for the full API from the optimized core API would be quite welcome. Have you considered using DrIFT? IIRC

Re: [Haskell-cafe] Can we do better than duplicate APIs? [was: Data.CompactString 0.3]

2007-03-24 Thread Robert Dockins
On Friday 23 March 2007 18:55, Benjamin Franksen wrote: [sorry for the somewhat longer rant, you may want to skip to the more technical questions at the end of the post] Twan van Laarhoven wrote: I would like to announce version 0.3 of my Data.CompactString library. Data.CompactString is a

Re: [Haskell-cafe] what I learnt from my first serious haskell programm

2007-03-19 Thread Robert Dockins
On Mar 19, 2007, at 9:56 AM, Henning Thielemann wrote: On Mon, 19 Mar 2007, Fawzi Mohamed wrote: A practice I've seen a lot in small- to mid-sized programs is to have a Types module that contains definitions of the types used in the program. ok I will think about it I'd avoid that and

Re: [Haskell-cafe] Church Encoding Function

2007-03-10 Thread Robert Dockins
On Saturday 10 March 2007 09:43, Joachim Breitner wrote: Hi, some more ideas following from the last post. I noticed how the function Data.Maybe.maybe converts a Haskell Maybe into a Church encoded Maybe. Also, the if construct, interpreted as a function, converts a Bool into a church

Re: [Haskell-cafe] pythags

2007-02-12 Thread Robert Dockins
On Feb 12, 2007, at 11:02 AM, [EMAIL PROTECTED] wrote: Hello, the Advanced Monads page in the Haskell Wikibook (http://en.wikibooks.org/wiki/Haskell/Advanced_monads) contains the following example of a List Monad pythags = do x - [1..] y - [x..] z - [y..]

Re: [Haskell-cafe] pythags

2007-02-12 Thread Robert Dockins
On Feb 12, 2007, at 11:02 AM, [EMAIL PROTECTED] wrote: Hello, the Advanced Monads page in the Haskell Wikibook (http://en.wikibooks.org/wiki/Haskell/Advanced_monads) contains the following example of a List Monad pythags = do x - [1..] y - [x..] z - [y..]

Re: [Haskell-cafe] questions about core

2007-02-12 Thread Robert Dockins
On Feb 12, 2007, at 1:31 PM, Kirsten Chevalier wrote: On 2/11/07, Matt Roberts [EMAIL PROTECTED] wrote: - Exactly what are the operational and denotational semantics of core? Since I don't think this question has been answered yet, here's a mailing list post from Simon PJ that probably

Re: [Haskell-cafe] factorising to prime numbers

2007-02-09 Thread Robert Dockins
On Feb 9, 2007, at 9:20 AM, Dougal Stanton wrote: Hi folks, I recently read in my copy of Concrete Mathematics the relationship between prime factors powers and lcm/gcd functions. So I decided to reimplement gcd and lcm the long way, for no other reason than because I could. If you look at

Re: [Haskell-cafe] List operation question

2007-02-04 Thread Robert Dockins
On Sunday 04 February 2007 14:24, Nicolas Frisby wrote: I've always thought that when certain operations are of particular interest, it's time to use more appropriate data structures, right? Lists are great and simple and intuitive, but if you need such operations as shifts, something like a

Re: [Haskell-cafe] Replacing [a] with (Set c a) in Monad instance.

2007-01-30 Thread Robert Dockins
On Tuesday 30 January 2007 20:06, Bryan Donlan wrote: Daniel McAllansmith wrote: Hello. Given: newtype Dist a = D {unD :: [(a,Int)]} instance Monad Dist where return x = D [(x,1)] d = f = D [(y,q*p) | (x,p) - unD d, (y,q) - unD (f x)] fail _ = D [] How would one

Re: [Haskell-cafe] Channel9 Interview: Software Composability and the Future of Languages

2007-01-30 Thread Robert Dockins
On Tuesday 30 January 2007 19:02, Bulat Ziganshin wrote: Hello Tim, Saturday, January 27, 2007, 10:23:31 PM, you wrote: Humm. While I can accept that this is a valid criticism of Haskell's monadic structure for dealing with I/O, I fail to see how it could drive a decision to prefer an

[Haskell-cafe] Re: Fixed-point operator (was: seq does not preclude parametricity)

2007-01-28 Thread Robert Dockins
On Sunday 28 January 2007 23:19, Matthew Brecknell wrote: On Wed, 24 Jan 2007 10:41:09 -0500, Robert Dockins wrote: newtype Mu a = Roll { unroll :: Mu a - a } omega :: a omega = (\x - (unroll x) x) (Roll (\x - (unroll x) x)) fix :: (a - a) - a fix f = (\x - f . (unroll x) x) (Roll

Re: [Haskell-cafe] Channel9 Interview: Software Composability and the Future of Languages

2007-01-27 Thread Robert Dockins
On Friday 26 January 2007 22:14, Tim Newsham wrote: impractical language, only useful for research. Erik Meijer at one point states that programming in Haskell is too hard and compares it to assembly programming! He brings up a very good point. Using a monad lets you deal with side

Re: [Haskell-cafe] IO is not a monad

2007-01-25 Thread Robert Dockins
On Jan 25, 2007, at 6:57 AM, Yitzchak Gale wrote: Scott Turner wrote: Paul B. Levy's studies of call-by-push-value model strictness/ laziness using a category theoretic approach. That sounds interesting. Do you have a reference for that? http://www.cs.bham.ac.uk/~pbl/papers/ The first

Re: seq does not preclude parametricity (Re: [Haskell-cafe] IO is not a monad)

2007-01-24 Thread Robert Dockins
On Jan 24, 2007, at 8:27 AM, Lennart Augustsson wrote: Well, I think fix destroys parametricity too, and it would be better to get rid of fix. But I'm not proposing to do that for Haskell, because I don't have a viable proposal to do so. (But I think the proposal would be along the same

Re: [Haskell-cafe] Re: seq does not preclude parametricity (Re: IO is not a monad)

2007-01-24 Thread Robert Dockins
On Wednesday 24 January 2007 20:20, Stefan Monnier wrote: FYI, don't try to run this in GHC, because it gives the simplifier fits. You mean it triggers a bug in the inliner? http://www.haskell.org/ghc/docs/latest/html/users_guide/bugs.html Third bullet in secion 12.2.1. I gather that GHC

Re: [Haskell-cafe] IO is not a monad (and seq, and in general _|_)

2007-01-23 Thread Robert Dockins
On Jan 23, 2007, at 2:09 PM, Brandon S. Allbery KF8NH wrote: Can someone explain to me, given that (a) I'm not particularly expert at maths, (b) I'm not particularly expert at Haskell, and (c) I'm a bit fuzzybrained of late: Given that _|_ represents in some sense any computation not

Re: [Haskell-cafe] STM and random numbers

2007-01-12 Thread Robert Dockins
On Jan 12, 2007, at 10:58 AM, Chad Scherrer wrote: Hi, I'd like to be able to use randomIO, but I'm working within the context of STM. Is there a way to get these working together happily? For now, I guess I could kludgingly use unsafePerformIO inside STM (it's the other way around that's

Re: [Haskell-cafe] FD problem in GHC 6.6

2006-12-20 Thread Robert Dockins
On Dec 19, 2006, at 10:11 PM, Dan Weston wrote: instance CommandFunction (Sh st ()) st where ^ I think your first argument (on which the second has a functional dependence) does not determine the second argument, since it makes use of st in the first

Re: [Haskell-cafe] Re: Versioning

2006-12-20 Thread Robert Dockins
On Dec 20, 2006, at 2:37 PM, Joachim Durchholz wrote: Ross Paterson schrieb: It might be not feasible though. The papers mention that you can't serialize (well, actually unserialize) function values with it. For the envisioned update-through-marshalling process, this would prevent me

Re: [Haskell-cafe] [Haskell] Defining Cg, HLSL style vectors in Haskell

2006-11-28 Thread Robert Dockins
On Nov 28, 2006, at 7:46 AM, Slavomir Kaslev wrote: Hello, I have to define a couple of float2, float3, float4 Cg, HLSL style vectors in Haskell. At first I was tempted to make them instances of Num, Floating, RealFrac, etc. but some of the functions defined in those classes have no sense for

Re: [Haskell-cafe] Collection of objects?

2006-11-17 Thread Robert Dockins
On Nov 17, 2006, at 12:36 PM, Valentin Gjorgjioski wrote: Is some kind of collection of object with different types in Haskell exist? Except the tuples, which have fixed length. I find this * Tuples heterogeneous, lists homogeneous. * Tuples have a fixed length, or at least their

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-15 Thread Robert Dockins
On Nov 15, 2006, at 9:48 AM, Jón Fairbairn wrote: Simon Peyton-Jones [EMAIL PROTECTED] writes: | The problem I see is that head/fromJust errors are usually |caused by *beginner* Haskellers, who don't know the |techniques for statically avoiding them. I don't agree. My programs have

Re: [Haskell-cafe] Re: Debugging partial functions by the rules

2006-11-15 Thread Robert Dockins
On Wednesday 15 November 2006 15:53, John Hughes wrote: From: Robert Dockins [EMAIL PROTECTED] It seems to me that every possible use of a partial function has some (possibly imagined) program invariant that prevents it from failing. Otherwise it is downright wrong. 'head', 'fromJust

[Haskell-cafe] Re: Fractional/negative fixity?

2006-11-08 Thread Robert Dockins
On Nov 8, 2006, at 3:58 AM, [EMAIL PROTECTED] wrote: Lennart Augustsson wrote: On Nov 7, 2006, at 11:47 , [EMAIL PROTECTED] wrote: Henning Thielemann wrote: On Tue, 7 Nov 2006, Simon Marlow wrote: I'd support fractional and negative fixity. It's a simple change to make, but we also

Re: [Haskell-cafe] Error building Edison 1.2.0.1

2006-10-18 Thread Robert Dockins
On Oct 17, 2006, at 1:46 PM, Gregory Wright wrote: On Oct 17, 2006, at 1:07 PM, Robert Dockins wrote: On Oct 17, 2006, at 12:55 PM, Gregory Wright wrote: Hi Rob, I've built Edison 1.2.0.1 using ghc-6.6. (I'm testing the macports, formerly darwinports, packages for the new 6.6 release

Re: [Haskell-cafe] Newbie and working with IO Int and Int

2006-10-17 Thread Robert Dockins
On Oct 17, 2006, at 12:21 PM, Víctor A. Rodríguez wrote: Hi all, I'm really newbie to Haskell, and working on a program I'm trying to make some testing. I make some test on certain know values ( e.g. adding 10 to 15 must return 25) and some test on random values (eg. adding rnd1 to rnd2

Re: [Haskell-cafe] Error building Edison 1.2.0.1

2006-10-17 Thread Robert Dockins
On Oct 17, 2006, at 12:55 PM, Gregory Wright wrote: Hi Rob, I've built Edison 1.2.0.1 using ghc-6.6. (I'm testing the macports, formerly darwinports, packages for the new 6.6 release.) The build goes fine, but the ./Setup register fails claiming that the directory

Re: [Haskell-cafe] Newbie and working with IO Int and Int

2006-10-17 Thread Robert Dockins
On Oct 17, 2006, at 1:37 PM, Víctor A. Rodríguez wrote: What's wrong with doing it this way? -- ** UNTESTED CODE ** verifyAdd :: Int -gt; Int -gt; Int -gt; Bool verifyAdd a b sum | a + b == sum = True otherwise = False testAddMundane :: Int -gt; Int -gt; Bool testAddMundane a b = verifyAdd

Re: [Haskell-cafe] function result caching

2006-10-14 Thread Robert Dockins
On Saturday 14 October 2006 13:13, Ketil Malde wrote: Robert Dockins [EMAIL PROTECTED] writes: slowFunctionCacheList= [slowFunction (i) | i -[0..500]] and use slowFunctionCacheList !! i instead of slowFunction (i) Not much different in principle, but better in practice - you could

Re: [Haskell-cafe] function result caching

2006-10-13 Thread Robert Dockins
On Friday 13 October 2006 16:15, Ketil Malde wrote: Silviu Gheorghe [EMAIL PROTECTED] writes: slowFunctionCacheList= [slowFunction (i) | i -[0..500]] and use slowFunctionCacheList !! i instead of slowFunction (i) i am still curious about a better method (and a general one) Not much

Re: [Haskell-cafe] beginner's problem about lists

2006-10-11 Thread Robert Dockins
On Oct 11, 2006, at 10:14 AM, Malcolm Wallace wrote: Matthias Fischmann [EMAIL PROTECTED] wrote: No, your Fin type can also hold infinite values. let q = FinCons 3 q in case q of FinCons i _ - i == _|_ does that contradict, or did i just not understand what you are saying? That may be

Re: [Haskell-cafe] beginner's problem about lists

2006-10-11 Thread Robert Dockins
On Oct 11, 2006, at 11:14 AM, Ross Paterson wrote: On Wed, Oct 11, 2006 at 11:04:49AM -0400, Robert Dockins wrote: let q = seq q (FinCons 3 q) in q(beta) We have (from section 6.2): seq _|_ y = _|_ seq x y = yiff x /= _|_ Now, here we have an interesting

Re: [Haskell-cafe] a monad for secret information

2006-10-10 Thread Robert Dockins
On Oct 10, 2006, at 12:04 PM, Seth Gordon wrote: data Secret a = Secret {password :: String, value :: a} classify :: String - a - Secret a classify = Secret declassify :: String - Secret a - Maybe a declassify guess (Secret pw v) | guess == pw = Just v

Re: [Haskell-cafe] Error building Edison 1.2.0.1

2006-10-05 Thread Robert Dockins
On Thursday 05 October 2006 16:51, Lyle Kopnicky wrote: Robert Dockins wrote: On Wednesday 04 October 2006 16:16, Lyle Kopnicky wrote: Robert Dockins wrote: Whats the output of ghc-pkg -l ? [EMAIL PROTECTED]:~$ ghc-pkg -l /usr/local/lib/ghc-6.5.20060924/package.conf

Re: [Haskell-cafe] Error building Edison 1.2.0.1

2006-10-04 Thread Robert Dockins
On Tuesday 03 October 2006 22:58, Lyle Kopnicky wrote: Robert Dockins wrote: On Tuesday 03 October 2006 22:00, Lyle Kopnicky wrote: Hi folks, I tried to build edison-1.2.0.1-sources with the command 'make system' but got: *** Exception: Line 10: Unknown field 'hs-source-dirs' I

Re: [Haskell-cafe] Error building Edison 1.2.0.1

2006-10-04 Thread Robert Dockins
On Wednesday 04 October 2006 16:16, Lyle Kopnicky wrote: Robert Dockins wrote: On Tuesday 03 October 2006 22:58, Lyle Kopnicky wrote: Robert Dockins wrote: On Tuesday 03 October 2006 22:00, Lyle Kopnicky wrote: Hi folks, I tried to build edison-1.2.0.1-sources with the command 'make

Re: [Haskell-cafe] Error building Edison 1.2.0.1

2006-10-03 Thread Robert Dockins
On Tuesday 03 October 2006 22:00, Lyle Kopnicky wrote: Hi folks, I tried to build edison-1.2.0.1-sources with the command 'make system' but got: *** Exception: Line 10: Unknown field 'hs-source-dirs' I am using GHC 6.4.1. Any idea how to fix this? You are probably using an older version

Re: [Haskell-cafe] Is Haskell a 5GL?

2006-09-29 Thread Robert Dockins
On Sep 28, 2006, at 8:47 PM, David Curran wrote: Sorry if this comes across as the rant it is. If you are interested in doing useful stuff rather then navel gazing please stop here. Where are compute languages going? I think multi core, distributed, fault tolerant. So you would end up with a

Re: [Haskell-cafe] Optimizing a title matcher

2006-09-26 Thread Robert Dockins
On Tuesday 26 September 2006 16:44, Lyle Kopnicky wrote: Hi folks, I'm competing in a contest at work, and we're allowed to use whatever language we want. I decided this was my chance to prove to people that Haskell was up to the challenge. Unfortunately, I ran into performance problems.

Re: [Haskell-cafe] Re: Optimization problem

2006-09-19 Thread Robert Dockins
On Sep 19, 2006, at 8:52 AM, Conor McBride wrote: Hi folks [EMAIL PROTECTED] wrote: Btw, why are there no irrefutable patterns for GADTs? I mean, such a sin should be shame for a non-strict language... Just imagine data Eq a b where Refl :: Eq a a coerce :: Eq a b - a - b coerce

Re: [Haskell-cafe] Monad laws

2006-09-07 Thread Robert Dockins
On Sep 7, 2006, at 9:04 AM, Lennart Augustsson wrote: Brian, Are you really sure Haskell compilers do that optimization? I would regard a compiler that does optimizations that are justified by laws that the compiler cannot check as broken. What, like list fusion? ;-) Although, more

Re: [Haskell-cafe] Exercise in point free-style

2006-09-01 Thread Robert Dockins
On Friday 01 September 2006 11:44, Neil Mitchell wrote: Hi func2 f g l = filter f (map g l) is func2p f g = (filter f) . (map g) func2 = (. map) . (.) . filter Again, how anyone can come up with a solution like this, is entirely beyond me... To answer part of the OP's question, it's

Re: [Haskell-cafe] getContents and lazy evaluation

2006-09-01 Thread Robert Dockins
On Friday 01 September 2006 15:19, Tamas K Papp wrote: Hi, I am newbie, reading the Gentle Introduction. Chapter 7 (Input/Output) says Pragmatically, it may seem that getContents must immediately read an entire file or channel, resulting in poor space and time performance under

Re: [Haskell-cafe] getContents and lazy evaluation

2006-09-01 Thread Robert Dockins
On Friday 01 September 2006 16:46, Duncan Coutts wrote: On Fri, 2006-09-01 at 16:28 -0400, Robert Dockins wrote: On Friday 01 September 2006 15:19, Tamas K Papp wrote: Hi, I am newbie, reading the Gentle Introduction. Chapter 7 (Input/Output) says Pragmatically, it may seem

Re: [Haskell-cafe] getContents and lazy evaluation

2006-09-01 Thread Robert Dockins
On Friday 01 September 2006 18:01, Donn Cave wrote: On Fri, 1 Sep 2006, Robert Dockins wrote: On Friday 01 September 2006 16:46, Duncan Coutts wrote: ... Note also, that with lazy IO we can write really short programs that are blindingly quick. Lazy IO allows us to save a copy through

Re: [Haskell-cafe] Re: A free monad theorem?

2006-08-31 Thread Robert Dockins
So getting the value out of the monad is not a pure function (extract :: Monad m = m a - a). I think I stated that, already, in my previous post. I'd even say that the monadic values alone can be completely meaningless. They often have a meaning only relative to some environment, thus are

Re: [Haskell-cafe] a novice Alex question

2006-08-25 Thread Robert Dockins
On Aug 25, 2006, at 6:27 AM, Xiong Yingfei wrote: Hi, I am trying out Alex. I copied the calculator specification file from Alex's official document and changed the wrapper type from basic to monad. However, after I generated the .hs file from the lexical specification and compiled the

Re: [Haskell-cafe] Derived Read instance for types with infix constructors (ghc 6.4.1)

2006-08-25 Thread Robert Dockins
On Aug 25, 2006, at 6:50 PM, Misha Aizatulin wrote: hi, the Haskell Report 10.4 says that The result of show is readable by read if all component types are readable however if I define a type like data T = A | T `And` T deriving (Read, Show) then *Main show $ A `And` A A And A

Re: [Haskell-cafe] extreme newbie: hugs prompt vs load module

2006-08-23 Thread Robert Dockins
On Aug 23, 2006, at 10:16 AM, George Young wrote: [linux, ghci 6.4.3.20060820, hugs May 2006] I have just started learning Haskell. I have hugs and ghci under linux, and I'm going through the Gentle Introduction to Haskellhttp://www.haskell.org/tutorial, so far through section 4, case

Re: [Haskell-cafe] implementing a csv reader

2006-08-23 Thread Robert Dockins
On Aug 23, 2006, at 3:37 PM, Henk-Jan van Tuyl wrote: L.S., Reading and writing a comma seperated datafile doesn't have to be that complicated; the following is an easy way to read a CSV file into a list of tuples and display the list on screen: For every complex problem, there is a

Re: [Haskell-cafe] Haskell wiki: most popular pages

2006-08-18 Thread Robert Dockins
On Aug 18, 2006, at 12:23 PM, Tim Walkenhorst wrote: Bulat Ziganshin wrote: i think that definitions with omitted arguments can be more hrd to understand to newbie haskellers, especiallyones who not yet know the language. as Tamas suggests, this page can be used to present to such newbies

Re: [Haskell-cafe] The Q Programming Language can do symbolic manipulation -- Haskell?

2006-08-16 Thread Robert Dockins
On Aug 15, 2006, at 11:43 PM, Casey Hawthorne wrote: The Q Programming Language can do symbolic manipulation -- Haskell? The Q Programming Language can do the following: sqr X = X*X ==sqr 5 25 ==sqr (X+1) (X+1)*(X+1) Can Haskell do symbolic manipulation? Well, there's always the

Re: [Haskell-cafe] Why Not Haskell?

2006-08-09 Thread Robert Dockins
On Aug 8, 2006, at 5:36 PM, Albert Lai wrote: Brian Hulley [EMAIL PROTECTED] writes: Also, the bottom line imho is that Haskell is a difficult language to understand, and this is compounded by the apparent cleverness of unreadable code like: c = (.) . (.) when a normal person would

Re: [Haskell-cafe] Abstract Data Types

2006-08-09 Thread Robert Dockins
On Aug 9, 2006, at 5:27 AM, Johan Grönqvist wrote: Hi, I have a question: Short version: If I want to hide the implementation of a data-type Stack a from the rest of the program, do I need to put its definition in a separate file? This is the usual way, as you've probably gathered.

Re: [Haskell-cafe] Why shouldn't variable names be capitalized?

2006-08-04 Thread Robert Dockins
On Aug 4, 2006, at 1:12 PM, Martin Percossi wrote: Hi, I'm wondering what the rationale was for not allowing capitalized variable names (and uncapitalized type names and constructors). I can only think of two arguments, and IMHO both of them are bad: 1. Enforces a naming convention.

Re: [Haskell-cafe] Edison StandardSet has inefficient function implementation

2006-08-03 Thread Robert Dockins
On Aug 3, 2006, at 7:14 AM, Ahn, Ki Yung wrote: Edision does not yet have all the asymtotic description of its functions. Indeed. This is a big job which requires a lot of time, attention to detail, and a pretty good working understanding of lazy amortized analysis. Unfortunately I'm

Re: [Haskell-cafe] The difficulty of designing a sequence class

2006-08-01 Thread Robert Dockins
On Jul 31, 2006, at 10:27 PM, John Meacham wrote: [snip] It is best to think of haskell primitives as something completely new, they reuse some naming conventions from OO programming, but that doesn't mean they suffer from the same limitations. It took me a few trys to wrap my brain

[Haskell-cafe] Future Edison directions

2006-08-01 Thread Robert Dockins
Hello all, There has been very recently a thread discussing the design decisions involved in creating a sequence abstraction. This was naturally of interest to me as the current Edison maintainer, and generated a fair bit of interesting discussion. I'd like to kick off a new thread

Re: [Haskell-cafe] The difficulty of designing a sequence class

2006-07-31 Thread Robert Dockins
On Jul 30, 2006, at 5:28 PM, Brian Hulley wrote: Robert Dockins wrote: On Sunday 30 July 2006 07:47, Brian Hulley wrote: Another option, is the Edison library which uses: class (Functor s, MonadPlus s) = Sequence s where so here MonadPlus is used instead of Monoid to provide empty

Re: [Haskell-cafe] The difficulty of designing a sequence class

2006-07-30 Thread Robert Dockins
On Sunday 30 July 2006 07:47, Brian Hulley wrote: Hi - Part 1 of 2 - Monoid versus MonadPlus === I've just run into a troublesome question when trying to design a sequence class: class ISeq c a | c - a where empty :: c single :: a - c

Re: [Haskell-cafe] Re: ANN: System.FilePath 0.9

2006-07-26 Thread Robert Dockins
On Jul 26, 2006, at 1:47 PM, Neil Mitchell wrote: Hi, Perhaps instead: directoryOf :: FilePath - String filenameOf :: FilePath - String extensionOf :: FilePath - String basenaneOf :: FilePath - String replaceFilename = joinFilePath . directoryOf replaceDirectory = flip

Re: [Haskell-cafe] Comma in the front

2006-07-13 Thread Robert Dockins
On Jul 12, 2006, at 9:18 PM, Joel Reymont wrote: Are cool kids supposed to put the comma in front like this? , foo , bar , baz Is this for historical or other reasons because Emacs formats Haskell code well enough regardless. Thanks, Joel I personally like this style. It's a

Re: [Haskell-cafe] help with creating a DAG?

2006-07-08 Thread Robert Dockins
On Saturday 08 July 2006 12:25 pm, David Roundy wrote: Hi all, I'm wanting to create a data structure to hold a directed acyclic graph (which will have patches represented by edges), and haven't yet been able to figure out a nice representation. I'd like one that can be reasoned with

Re: [Haskell-cafe] Prefix/Infix operators

2006-07-07 Thread Robert Dockins
On Jul 7, 2006, at 8:57 AM, Sara Kenedy wrote: Hello everybody, I checked the topics in Haskell-Cafe about prefix/infix operators but I did not find them. Now I bring my questions to here to ask you. 1) I have a Common-Lisp code representing an expression result as follows ((MPLUS SIMP)

[Haskell-cafe] Re: [Haskell] Re: ANNOUNCE: HNOP 0.1

2006-06-30 Thread Robert Dockins
[moved to cafe] On Jun 30, 2006, at 4:01 AM, Ashley Yakeley wrote: In article [EMAIL PROTECTED] , Bayley, Alistair [EMAIL PROTECTED] wrote: Cool, that's awesome. But I don't see any Haddock docs? Or a Cabal Setup.hs? Would it be much trouble to add them? Bear in mind HNOP compiles just

Re: [Haskell-cafe] Packages and modules

2006-06-25 Thread Robert Dockins
On Sunday 25 June 2006 05:16 am, Brian Hulley wrote: Hi - At the moment there is a problem in that two packages P and Q could contain the same hierarchical module eg Data.Foo, and the only way for user code to ensure the right Data.Foo is used is to ensure that packages P and Q are searched

Re: [Haskell-cafe] Functional progr., images, laziness and all therest

2006-06-22 Thread Robert Dockins
On Jun 22, 2006, at 10:16 AM, Brian Hulley wrote: minh thu wrote: 2006/6/22, Brian Hulley [EMAIL PROTECTED]: Jerzy Karczmarczuk wrote: Brian Hulley wrote: [snip] y IS NOT a longer list than yq, since co-recursive equations without limiting cases, apply only to *infinite* streams.

Re: [Haskell-cafe] Re: Functional programming for processing of largeraster images

2006-06-21 Thread Robert Dockins
On Jun 21, 2006, at 3:30 PM, Brian Hulley wrote: Joel Reymont wrote: I think the issue wasn't using functional programming for large image processing, it was using Haskell. OCaml is notoriously fast and strict. Haskell/GHC is... lazy. Everyone knows that laziness is supposed to be a virtue.

Re: [Haskell-cafe] Computing lazy and strict list operations at the same time

2006-06-19 Thread Robert Dockins
On Jun 19, 2006, at 11:24 AM, C Rodrigues wrote: Here's a puzzle I haven't been able to solve. Is it possible to write the initlast function? There are functions init and last that take constant stack space and traverse the list at most once. You can think of traversing the list as

Re: [Haskell-cafe] Computing lazy and strict list operations at the same time

2006-06-19 Thread Robert Dockins
On Jun 19, 2006, at 12:50 PM, Duncan Coutts wrote: On Mon, 2006-06-19 at 17:03 +0100, Jon Fairbairn wrote: On 2006-06-19 at 15:24- C Rodrigues wrote: Here's a puzzle I haven't been able to solve. Is it possible to write the initlast function? There are functions init and last that

Re: [Haskell-cafe] Lambda abstraction analogous to imperative pseudo-code?

2006-06-10 Thread Robert Dockins
On Saturday 10 June 2006 04:35 pm, Clifford Beshers wrote: The Wikipedia article on lambda abstractions (http://en.wikipedia.org/wiki/Lambda_abstraction) has a statement that does not resonate with me: A lambda abstraction is to a functional programming

Re: [Haskell-cafe] Tips for converting Prolog to typeclasses?

2006-05-31 Thread Robert Dockins
On Wednesday 31 May 2006 08:22 pm, Greg Buchholz wrote: Lately, in my quest to get a better understanding of the typeclass system, I've been writing my typeclass instance declarations in Prolog first, then when I've debugged them, I port them over back over to Haskell. The porting process

[Haskell-cafe] Re: [Haskell] (.) . (.)

2006-05-28 Thread Robert Dockins
On Sunday 28 May 2006 05:50 pm, you wrote: [moved to cafe] Robert Dockins wrote: On Sunday 28 May 2006 05:02 pm, Brian Hulley wrote: I see my error was that I was reversing the args in eta expansion, so the correct derivation is: FYI, eta-expansions isn't valid in Haskell. Its safe

Re: [Haskell-cafe] Haskell RPC

2006-05-25 Thread Robert Dockins
On May 25, 2006, at 2:25 PM, Jason Dagit wrote: On 5/25/06, Joel Reymont [EMAIL PROTECTED] wrote: This is an example from my test harness: (define-test remote-basic (def-remote-class remote (server) ()) (def-remote-method sum :sync ((self remote) (a fixnum) (b integer))

[Haskell-cafe] Re: [Haskell] TypeCasting in Haskell

2006-05-24 Thread Robert Dockins
On May 24, 2006, at 7:30 AM, Christophe Poucet wrote: Dear all, I typically use indirect composite for making AST's. It allows me to easily make new types with other annotations without having to duplicate all elements but only those that actually change. It also allows a whole amalgam

Re: [Haskell-cafe] The values of infinite lists

2006-05-23 Thread Robert Dockins
On May 23, 2006, at 9:50 AM, Paul Hudak wrote: Hi Claus -- I think that you're asking for a semantics of the entire OS, i.e. the entire outside world, and for that I agree that something other than equational reasoning is needed to reason about it. However, I would argue that that is

Re: [Haskell-cafe] Problem trying to get class Bounded to work

2006-05-23 Thread Robert Dockins
On May 23, 2006, at 11:13 AM, Jacques Carette wrote: Bertram Felgenhauer wrote: Jacques Carette wrote: Bulat Ziganshin wrote: malloc :: Storable a = IO (Ptr a) malloc = doMalloc undefined where doMalloc :: Storable b = b - IO (Ptr b) doMalloc dummy = mallocBytes (sizeOf dummy)

Re: [Haskell-cafe] Newbie: Applying Unknown Number Arguments to A Partial Function

2006-05-19 Thread Robert Dockins
On May 19, 2006, at 2:49 PM, Jeremy Shaw wrote: Hello, You can do it -- but it may not be very useful in its current form. The primary problem is, What is the type of 'f'? applyArgument f [arg] = f arg -- NOTE: I changed (arg) to [arg] applyArgument f (arg:args) = applyArgument (f arg) args

[Haskell-cafe] Haskell DB and XML libs: one user's experience

2006-05-16 Thread Robert Dockins
Hello all, I recently found myself needing to do some data manipulation; I needed to take some data from a database and generate a series of XML files from it. In the past I've done most of this sort of work in Java, but this time I decided I'd take the opportunity to explore the state

Re: [Haskell-cafe] CDouble type coercion

2006-05-14 Thread Robert Dockins
On Sunday 14 May 2006 03:00 pm, SevenThunders wrote: Thanks that helps a bit. The realToFrac type coercion works, but ultimately it seems that printf won't play nice. Consider this simple haskell code module Test where import IO -- import Data.Array.Storable import Text.Printf

[Haskell-cafe] Re: [Haskell] FP-style vs. OO-style AST structure

2006-05-10 Thread Robert Dockins
[moved to haskell-cafe] On Wednesday 10 May 2006 11:09 am, Doug Kirk wrote: Hi, I'm a Haskell newbie, but not new to programming, and I have a question regarding style (I think). I'm writing a parser for OMG's OCL, and have two ways of defining the AST model of a constraint. Each

Re: [Haskell-cafe] The values of infinite lists

2006-05-10 Thread Robert Dockins
On Wednesday 10 May 2006 12:30 pm, Brian Hulley wrote: Bjorn Lisper wrote: Nontermination is not the precisely the same as _|_. Only certain kinds of nontermination can be modeled by _|_ in a non-strict language. What kinds of non-termination are *not* modelled by _|_ in Haskell?

Re: [Haskell-cafe] The values of infinite lists

2006-05-10 Thread Robert Dockins
On Wednesday 10 May 2006 02:49 pm, you wrote: Robert Dockins wrote: On Wednesday 10 May 2006 12:30 pm, Brian Hulley wrote: Bjorn Lisper wrote: Nontermination is not the precisely the same as _|_. Only certain kinds of nontermination can be modeled by _|_ in a non-strict language

Re: [Haskell-cafe] Current situation regarding global IORefs

2006-04-24 Thread Robert Dockins
On Apr 24, 2006, at 2:42 AM, Adrian Hey wrote: Lennart Augustsson wrote: I think global mutable variables should be regarded with utmost suspicion. There are very few situations where they are the right solution. Well IMO even the use of the term global mutable variable causes muddled

[Haskell-cafe] Re: Control.Exceptions and MonadIO

2006-04-23 Thread Robert Dockins
On Sunday 23 April 2006 02:19 pm, you wrote: [snip some discussion] Perhaps something like: class MonadIO m = MonadIOE m where catch :: m a- (Exception - m a) - m a throw catchDyn throwDyn -- etc instance MonadIOE m = StateT s m where ... instance MonadIOE m =

Re: [Haskell-cafe] Current situation regarding global IORefs

2006-04-21 Thread Robert Dockins
On Apr 21, 2006, at 9:56 AM, Brian Hulley wrote: Hi - I've run into the global mutable state problem described in http:// www.haskell.org/hawiki/GlobalMutableState Since the page was last edited in March last year, I'm wondering if there have been any developments or further thoughts on how

Re: [Haskell-cafe] Current situation regarding global IORefs

2006-04-21 Thread Robert Dockins
On Apr 21, 2006, at 10:34 AM, Brian Hulley wrote: Robert Dockins wrote: On Apr 21, 2006, at 9:56 AM, Brian Hulley wrote: Hi - I've run into the global mutable state problem described in http:// www.haskell.org/hawiki/GlobalMutableState Since the page was last edited in March last year, I'm

Re: [Haskell-cafe] Current situation regarding global IORefs

2006-04-21 Thread Robert Dockins
On Apr 21, 2006, at 1:27 PM, Brian Hulley wrote: Robert Dockins wrote: On Apr 21, 2006, at 10:34 AM, Brian Hulley wrote: Robert Dockins wrote: On Apr 21, 2006, at 9:56 AM, Brian Hulley wrote: Hi - I've run into the global mutable state problem described in http:// [snip] There is only

Re: [Haskell-cafe] Advice needed on best way to simulate an STL vector

2006-04-19 Thread Robert Dockins
On Apr 19, 2006, at 3:06 PM, Brian Hulley wrote: Thanks. I might try this if I don't have any luck with finger trees (from Udo's post), or if they seem too heavy for the simple thing I'm planning to use them for (implementing the text buffer for an edit control which needs a mutable array

Re: [Haskell-cafe] Counting bits: Sanity Check

2006-04-12 Thread Robert Dockins
On Apr 11, 2006, at 10:09 AM, David F. Place wrote: Hi All, Since it seems that real applications need more than just union, intersection, difference and complement to be fast to make EnumSet useful, I've been looking into the less naive approaches to the other things. In particular,

Re: [Haskell-cafe] Ambiguous types for collection keys

2006-04-12 Thread Robert Dockins
On Apr 12, 2006, at 3:18 PM, Scott Weeks wrote: Well, if you get an ambiguous type variable error, you probably (I think) need to add some type annotations. For example: class Foo a where foo :: a bar :: a - String Evaluating bar foo will result in an error, but bar (foo :: Integer)

Re: [Haskell-cafe] Ambiguous types for collection keys

2006-04-12 Thread Robert Dockins
On Apr 12, 2006, at 4:09 PM, Scott Weeks wrote: Or carry an instance in along with a type parameter, using existentials or GADT. Brandon Moore Do you know of an example that would apply to my situation? I think I neglected to state part of my problem. I am storing the root nodes of

  1   2   >