Re: [Haskell-cafe] splitting strings

2007-03-01 Thread Matthew Brecknell
"h." said: > splitS :: String -> String -> [String] > splitS a b = splitA a b > where > z = length b - 1 > splitA [] _ = [""] > splitA (c:cs) (d:ds) | c == d && fst s == ds = "" : splitA (snd s) b > | otherwise = (c : head r) : tail r > wher

Re: [Haskell-cafe] Re: OO Design in Haskell

2007-03-01 Thread P. R. Stanley
Hi forgive my ignorance but I thought functional programming was a mathematically sound framework unlike Object Oriented programming. Referentially transparent is a better term than mathematically sound here. This is the property that x = y means that instances of x can be replaced with y. C

Re: [Haskell-cafe] Literate haskell format unclear (implementation and specification inconsistencies)

2007-03-01 Thread Ian Lynagh
On Wed, Feb 28, 2007 at 05:48:09PM -0500, Isaac Dupree wrote: > > Trying to implement literate haskell[*], I realized several > ways in which the correct behavior for unliterating (especially with > regard to errors) was unclear. I have several cases which ghc, hugs > and Haskell 98 have differin

Re: [Haskell-cafe] Build failed - hidden package ?

2007-03-01 Thread Ian Lynagh
On Tue, Feb 27, 2007 at 05:36:29AM +0100, Dunric wrote: > > Graphics/UI/SDL/Rotozoomer.hs:15:7: > Could not find module `Foreign.C': > it is a member of package base, which is hidden This is normally caused by forgetting to include build-depends: base in a .cabal file. When cabal

Re: [Haskell-cafe] Re: OO Design in Haskell

2007-03-01 Thread Neil Mitchell
Hi forgive my ignorance but I thought functional programming was a mathematically sound framework unlike Object Oriented programming. Referentially transparent is a better term than mathematically sound here. This is the property that x = y means that instances of x can be replaced with y. I

Re: [Haskell-cafe] Re: OO Design in Haskell

2007-03-01 Thread P. R. Stanley
Hi folks forgive my ignorance but I thought functional programming was a mathematically sound framework unlike Object Oriented programming. Isn't using Haskell for OOP kind of defeating the whole object? And the pun wasn't deliberate./ Honest! Regards Paul __

Re: [Haskell-cafe] ANN: HSH 1.0.0

2007-03-01 Thread David Roundy
On Thu, Mar 01, 2007 at 01:47:38PM -0600, John Goerzen wrote: > Hello, > > I'm pleased to announce the first release of HSH. > > HSH is designed to let you mix and match shell expressions with Haskell > programs. With HSH, it is possible to easily run shell commands, capture > their output or pro

Re: [Haskell-cafe] Re: OO Design in Haskell Example (Draft)

2007-03-01 Thread Tim Docker
"Steve Downey" <[EMAIL PROTECTED]> wrote: > I'm not sure, though, what would happen if I tried to > add state to the types. With the previous example, > using existentials to create a reference type that > holds elements of a type class that matches the interface, > I think that it would be natura

[Haskell-cafe] Whatever happened to Trex.hs

2007-03-01 Thread Adam Wyner
Hi, I'd been using trex.hs for extensible records and programmed a bit using it. I liked it for what it did and also because it had very nice documentation on how to use it. I know there are other proposals and implementations in Haskell for records (HaskellDB and HList), but for the time b

[Haskell-cafe] ANN: HSH 1.0.0

2007-03-01 Thread John Goerzen
Hello, I'm pleased to announce the first release of HSH. HSH is designed to let you mix and match shell expressions with Haskell programs. With HSH, it is possible to easily run shell commands, capture their output or provide their input, and pipe them to/from other shell commands and arbitrary H

Re: [Haskell-cafe] Automatic Recognition of Functors

2007-03-01 Thread Nicolas Frisby
This link might be what you are after: http://okmij.org/ftp/Haskell/typecast.html#deepest-functor On 3/1/07, Walter Potter <[EMAIL PROTECTED]> wrote: Folks, Given f:: a -> b it is very natural to lift f to P f :: P a -> P b where P is the power set functor. Or L f :: [a] -> [b]. We are modeli

Re: [Haskell-cafe] numeric minimization in Haskell

2007-03-01 Thread Chad Scherrer
David Roundy wrote: It seems like GSLHaskell is an awfully big stick, when all you need are scalar multiply and vector addition. Of course, we don't know what functions he wants to minimize, but in the absence of any need for GSL functions, I don't see a good reason for it. The function is jus

[Haskell-cafe] Blog post: 'Haskell IO for imperative programmers'

2007-03-01 Thread David House
It's not mine, but I just came across the following from a link in #haskell: http://blogs.nubgames.com/code/?p=22 A brilliantly written, fantastically clear exposition of IO from the point of view of a long-time imperative programmer. Don't miss it. One to forward to friends and coworkers. -- -

[Haskell-cafe] Re: [Haskell] Laziness and the IO Monad (randomness)

2007-03-01 Thread Kirsten Chevalier
[redirecting to haskell-cafe] On 3/1/07, Dave Tapley <[EMAIL PROTECTED]> wrote: However this latter case gets stuck in an infinite loop, terminating on a stack overflow. My question asks why this is the case, when laziness should ensure only the first 10 cases need to be computed. You di

Re: [Haskell-cafe] splitting strings

2007-03-01 Thread Thomas Hartman
I think you want Text.Regex. splitRegex or something very much like it. http://haskell.org/hoogle/?q=String-%3E%5BString%5D 2007/3/1, h. <[EMAIL PROTECTED]>: Hello, I wrote the following split function for Strings: splitS :: String -> String -> [String] splitS a b = splitA a b where

Re: [Haskell-cafe] Re: OO Design in Haskell Example (Draft)

2007-03-01 Thread Steve Downey
The composite design pattern implemented using record types, where the named elements are the interface to the object Overall, I think I agree with Tim that the record types are simpler to code. I'm not sure, though, what would happen if I tried to add state to the types. With the previous exam

[Haskell-cafe] Re: Automatic Recognition of Functors

2007-03-01 Thread apfelmus
Walter Potter wrote: > Folks, > > Given f:: a -> b it is very natural to lift f to P f :: P a -> P b where > P is the power set functor. Or L f :: [a] -> [b]. > > We are modeling structures using repeated application of the power > functor, via repeated application of [ ]. > > It would be very n

[Haskell-cafe] Automatic Recognition of Functors

2007-03-01 Thread Walter Potter
Folks, Given f:: a -> b it is very natural to lift f to P f :: P a -> P b where P is the power set functor. Or L f :: [a] -> [b]. We are modeling structures using repeated application of the power functor, via repeated application of [ ]. It would be very nice if Haskell would recognize t

Re: [Haskell-cafe] Re: Hi can u explain me how drop works in Haskell

2007-03-01 Thread Thomas Hartman
I did do something with quickcheck, more to learn quickCheck than because it was really justified. Maybe it's overkill, maybe not, whichever way here's what I have. I would like prop_DroppedListLengthShorterOrSame to only test n > 0, but haven't gotten around to figuring out how to restrict the i

[Haskell-cafe] splitting strings

2007-03-01 Thread h .
Hello, I wrote the following split function for Strings: splitS :: String -> String -> [String] splitS a b = splitA a b where z = length b - 1 splitA [] _ = [""] splitA (c:cs) (d:ds) | c == d && fst s == ds = "" : splitA (snd s) b | otherwise = (

[Haskell-cafe] Re: bytestring vs polymorphic contiguous lists

2007-03-01 Thread Duncan Coutts
On Thu, 2007-03-01 at 00:22 +, Claus Reinke wrote: > >The main example of course is ByteString fusion as presented in our recent > >paper: > >http://www.cse.unsw.edu.au/~dons/papers/CSL06.html > > btw, why did you restrict yourself to improving [Char], rather than [a]? We're not finished! :-

Re: [Haskell-cafe] State monad in the wikibood article

2007-03-01 Thread TJ
Matthew Brecknell: Note the lambda abstraction (\st -> ...) at the beginning of the definition. This means that (container >>= fn) returns a *function* that maps an input state to the result of (container2 st2). It doesn't return the result of (container st2) directly. Ah. Silly me :D Thank