[Haskell-cafe] Call for Copy: Monad.Reader Issue 16

2010-02-12 Thread Brent Yorgey
Call for Copy: The Monad.Reader - Issue 16 -- Whether you're an established academic or have only just started learning Haskell, if you have something to say, please consider writing an article for The Monad.Reader! The submission deadline for Issue 16 will

Re: [Haskell-cafe] First time haskell - parse error!

2010-03-09 Thread Brent Yorgey
On Tue, Mar 09, 2010 at 08:42:44PM +0100, Sebastian Hungerecker wrote: > On 09.03.2010 20:04, boblettoj wrote: >> score :: String -> String -> String >> score [s] [] = false >> score [s] [g] = >> if valid 4 g >> then (s1 ++ s2 ++ s3 ++ s4) where >> s1 = "Golds " >>

Re: [Haskell-cafe] th-kinds v0.0.0

2010-03-16 Thread Brent Yorgey
ttempts to automatically infer the kind of a specified type, type > constructor, type family, type class, or pretty much anything else that has > a kind. > > This package was developed in response to a sort-of challenge from Brent > Yorgey on #haskell to create this functional

[Haskell-cafe] Second Call for Copy: Monad.Reader Issue 16

2010-03-16 Thread Brent Yorgey
I already have one or two submissions, but a few more would be great. If you've been thinking about submitting something but weren't sure or haven't gotten around to it yet, now's the time! -- Whether you're an established academic or have only just started learning Haskell, if you ha

Re: [Haskell-cafe] Strange typing?

2010-03-19 Thread Brent Yorgey
On Fri, Mar 19, 2010 at 03:15:02PM +, Ozgur Akgun wrote: > Hi Cafe! > > Disclaimer: I know what I'm going to ask is now available as a language > feature normally. > And sorry for the subject of this message, I couldn't compe up with a > good&descriptive subject. > > > Is there any way to li

Re: [Haskell-cafe] Trace

2010-03-19 Thread Brent Yorgey
On Fri, Mar 19, 2010 at 04:03:52PM -0400, Ben Derrett wrote: > > trace2 a = trace (show a) a > > In the definition of `trace2': trace2 a = (show a) a These don't match. It looks like maybe you forgot the call to trace in your definition of trace2? -Brent ___

[Haskell-cafe] Haskell hackathon in Philadelphia (Hac phi 2) in May?

2010-03-20 Thread Brent Yorgey
We are gauging interest in another Haskell hackathon to be hosted at U Penn in May, the weekend of either May 15 or May 22. If you might be interested in attending such a thing, send me an email (please DON'T reply to all!) with your name and whether you have a strong preference for one or the oth

[Haskell-cafe] Strange error with type classes + associated types

2010-04-13 Thread Brent Yorgey
Hi all, Consider the following declarations. > -- from vector-space package: > (*.*) :: (HasBasis u, HasTrie (Basis u), > HasBasis v, HasTrie (Basis v), > VectorSpace w, > Scalar v ~ Scalar w) > => (v :-* w) -> (u :-* v) -> u :-* w > > -- my co

Re: [Haskell-cafe] Strange error with type classes + associated types

2010-04-14 Thread Brent Yorgey
On Wed, Apr 14, 2010 at 09:51:52AM +0100, Stephen Tetley wrote: > On 14 April 2010 03:48, Brent Yorgey wrote: > > > Can someone more well-versed in the intricacies of type checking with > > associated types explain this?  Or is this a bug in GHC? > > If you take the defi

Re: [Haskell-cafe] Strange error with type classes + associated types

2010-04-14 Thread Brent Yorgey
On Thu, Apr 15, 2010 at 12:48:20AM +1000, Roman Leshchinskiy wrote: > > > > > Right, this seems weird to me. Why is there still a 'u' mentioned in > > the constraints? Actually, I don't even see why there ought to be > > both v and v1. The type of (*.*) mentions three type variables, u, v, and

Re: [Haskell-cafe] Nomic game in Haskell

2010-04-14 Thread Brent Yorgey
On Wed, Apr 14, 2010 at 09:14:18PM +0200, Dupont Corentin wrote: > Hello Café, > do you know Nomic? > > It's a fabulous and strange game where you have the right to change the > rules in the middle of the game! > In fact, changing the rules is the goal of the game. Changing a rule is > considered

Re: [Haskell-cafe] Strange error with type classes + associated types

2010-04-18 Thread Brent Yorgey
Conal, Thanks for looking into this! Making (:-*) into a proper type seems promising. I did try wrapping (:-*) in a newtype but that didn't help (although I didn't expect it to). I see you just uploaded a new version of vector-space; what's new in 0.6.2? -Brent On Sat, Apr 17, 2010 at 10:28:4

Re: [Haskell-cafe] Strange error with type classes + associated types

2010-04-19 Thread Brent Yorgey
On Mon, Apr 19, 2010 at 09:40:25AM -0700, Conal Elliott wrote: > On Sun, Apr 18, 2010 at 9:02 PM, Brent Yorgey wrote: > > > Conal, > > > > Thanks for looking into this! Making (:-*) into a proper type seems > > promising. I did try wrapping (:-*) in a newtype but

[Haskell-cafe] Philadelphia Haskell hackathon -- reduced hotel rate ends Friday April 23!

2010-04-21 Thread Brent Yorgey
There is still plenty of space to register [1] for Hac phi 2010, but time is running out to get a hotel room at a reduced rate --- if you want the special rate for the block of rooms we have reserved at the Club Quarters, you must contact the hotel by this Friday, April 23. Instructions are on the

[Haskell-cafe] ANN: Monad.Reader Issue 16

2010-05-12 Thread Brent Yorgey
I am very pleased to announce that Issue 16 of The Monad.Reader is now available [1]. Issue 16 consists of the following three articles: * "Demand More of Your Automata" by Aran Donohue * "Iteratee: Teaching an Old Fold New Tricks" by John W. Lato * "Playing with Priority Queues" by L

Re: [Haskell-cafe] ANN: Monad.Reader Issue 16

2010-05-14 Thread Brent Yorgey
On Fri, May 14, 2010 at 02:37:19PM +1000, Ivan Miljenovic wrote: > On 13 May 2010 04:12, Brent Yorgey wrote: > > > >    * "Demand More of Your Automata" by Aran Donohue > > Great, because of Aran I now can't change some of the bits of API in > graphviz

Re: [Haskell-cafe] ANN: Monad.Reader Issue 16

2010-05-14 Thread Brent Yorgey
On Fri, May 14, 2010 at 11:30:40PM +1000, Ivan Lazar Miljenovic wrote: > Brent Yorgey writes: > > > On Fri, May 14, 2010 at 02:37:19PM +1000, Ivan Miljenovic wrote: > >> On 13 May 2010 04:12, Brent Yorgey wrote: > >> > > >> >    * "Demand More

Re: [Haskell-cafe] Intuitive function given type signature

2010-05-19 Thread Brent Yorgey
On Wed, May 19, 2010 at 04:27:14AM +, R J wrote: > > What are some simple functions that would naturally have the following type > signatures: > f :: (Integer -> Integer) -> Integer Well, this means f is given a function from Integer to Integer, and it has to somehow return an Integer, (poss

Re: [Haskell-cafe] Proof format

2010-05-19 Thread Brent Yorgey
On Wed, May 19, 2010 at 01:12:16PM +, R J wrote: > > Is this how a rigorous Haskeller would lay out the proofs of the following > theorems? This is Bird 1.4.6. > (i) > Theorem: (*) x = (* x) > Proof: > (*) x ={definition of partial application} \y

Re: [Haskell-cafe] (no subject)

2010-05-19 Thread Brent Yorgey
On Wed, May 19, 2010 at 01:37:49PM +, R J wrote: > > This is another proof-layout question, this time from Bird 1.4.7. > We're asked to define the functions curry2 and uncurry2 for currying and > uncurrying functions with two arguments. Simple enough: > curry2 :: ((a, b) -> c) ->

Re: [Haskell-cafe] Intuitive function given type signature

2010-05-20 Thread Brent Yorgey
On Thu, May 20, 2010 at 11:53:09AM +1200, Richard O'Keefe wrote: > > On May 20, 2010, at 3:18 AM, Brent Yorgey wrote: > >> On Wed, May 19, 2010 at 04:27:14AM +, R J wrote: >>> >>> What are some simple functions that would naturally have the following

Re: [Haskell-cafe] name of this monadic combinator?

2010-05-30 Thread Brent Yorgey
On Sun, May 30, 2010 at 11:15:40AM -0700, Mike Dillon wrote: > begin Michael Snoyman quotation: > > http://hackage.haskell.org/packages/archive/base/4.2.0.1/doc/html/Control-Monad.html#v%3AliftM2 > > > > Strangely, > > Hayoo didn't turn this one up... anyone know why? > > Hoogle finds it. I didn'

Re: [Haskell-cafe] How to build an "Indicator Type" for a type class?

2010-06-02 Thread Brent Yorgey
Perhaps something here may be of use? http://okmij.org/ftp/Haskell/types.html#class-based-overloading http://okmij.org/ftp/Haskell/types.html#class-based-dispatch -Brent On Mon, May 31, 2010 at 01:32:18PM +0200, Steffen Schuldenzucker wrote: > Dear Cafe, > > let: > > > data True > > data F

Re: [Haskell-cafe] Why this doesn't type checked

2010-06-28 Thread Brent Yorgey
On Mon, Jun 28, 2010 at 08:51:45AM +0400, Victor Nazarov wrote: > > > >> What we get with this instances is following code. > >> > >> > main = > >> >   do print (sizeof :: Sizeof Word16) > >> > >> Let's try it. > >> > >> $ runhaskell this.lhs > >> this.lhs:78:14: > >>     Couldn't match expected ty

Re: [Haskell-cafe] Re: building a patched ghc

2010-06-28 Thread Brent Yorgey
I don't know the answer to your questions, but just wanted to note that you will probably get a better response on the glasgow-haskell-users mailing list. http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/mailing-lists-GHC.html -Brent On Fri, Jun 25, 2010 at 08:56:09PM -0700, braver wrot

Re: [Haskell-cafe] Type-Level Programming

2010-06-28 Thread Brent Yorgey
On Fri, Jun 25, 2010 at 02:26:54PM -0700, Walt Rorie-Baety wrote: > I've noticed over the - okay, over the months - that some folks enjoy the > puzzle-like qualities of programming in the type system (poor Oleg, he's > become #haskell's answer to the "Chuck Norris" meme commonly encountered in > M

[Haskell-cafe] Haskell Weekly News: Issue 114 - April 17, 2009

2009-04-17 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090417 Issue 114 - April 17, 2009 --- Welcome to issue 114 of HWN, a newsletter covering dev

[Haskell-cafe] Haskell Weekly News: Issue 115 - April 25, 2009

2009-04-25 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090425 Issue 115 - April 25, 2009 --- Welcome to issue 115 of HWN, a newsletter covering dev

Re: [Haskell-cafe] Typing efficient folds

2009-04-25 Thread Brent Yorgey
On Fri, Apr 24, 2009 at 06:52:09PM +, Keith Battocchi wrote: > I'm trying to write some code to do folds on nested datatypes as in > http://web.comlab.ox.ac.uk/people/Jeremy.Gibbons/publications/efolds.pdf but > running into trouble getting things to typecheck. > > Given the types > > data

Re: [Haskell-cafe] Type constraints and classes

2009-04-26 Thread Brent Yorgey
On Sun, Apr 26, 2009 at 03:23:17PM +0200, Thomas van Noort wrote: > This is a recurring problem[1] and I'm still looking for a really > satisfying solution. The only working and non-verbose solution I found is > the one Miguel suggests. Although I'm not too fond of splitting up the > monadic fun

Re: [Haskell-cafe] The essence of my monad confusion

2009-05-02 Thread Brent Yorgey
On Sat, May 02, 2009 at 05:31:03PM +0100, Paul Keir wrote: > On the wiki page for Applicative Functors > (http://www.haskell.org/haskellwiki/Applicative_functor) a familiar > characteristic of monads is quoted; that they "allow you to run actions > depending on the outcomes of earlier actions".

[Haskell-cafe] Haskell Weekly News: Issue 116 - May 2, 2009

2009-05-02 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090502 Issue 116 - May 02, 2009 --- Welcome to issue 116 of HWN, a newsletter covering devel

Re: [Haskell-cafe] Interesting Thread on OO Usefulness (scala mailing list)

2009-05-04 Thread Brent Yorgey
On Mon, May 04, 2009 at 03:08:25PM +0200, Martijn van Steenbergen wrote: > Andrew Wagner wrote: >> [quote] >> Here's [a]language to to interpret (where postfix * means tupling): >> Variables: x Integer literals: i Terms: t = Lambda x*. t | Apply t t* >> | Var(x) | Num(i) > > Can someone

Re: [Haskell-cafe] Darcs and binary files

2009-05-04 Thread Brent Yorgey
On Mon, May 04, 2009 at 02:52:17PM +0200, Gü?nther Schmidt wrote: > Hi, > > I've gotten used to darcs now, and use it for my project. There is one > quirk though, I also added some rather large binary files, an sqlite > database and an MS Access database to the repository. > > Now whenever I do a

Re: [Haskell-cafe] List comprehension

2009-05-05 Thread Brent Yorgey
On Tue, May 05, 2009 at 05:36:12PM +0200, Tillmann Rendel wrote: > > PS. I'm not a native speaker, but shouldn't it be "movies" and not "films"? Both are correct. =) -Brent ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/ma

Re: [Haskell-cafe] Inferred typing?

2009-05-12 Thread Brent Yorgey
On Mon, May 11, 2009 at 10:59:01PM -0700, michael rice wrote: > In the code below, is the type returned by the return functions inferred from > the result type in the function type signature, i.e., just change the result > type to Maybe Int and the code will return a Maybe monad, (Just 4), instead

[Haskell-cafe] Haskell Weekly News: Issue 117 - May 12, 2009

2009-05-12 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090512 Issue 117 - May 12, 2009 --- Welcome to issue 117 of HWN, a newsletter covering devel

Re: [Haskell-cafe] Pretty printing a tree

2009-05-14 Thread Brent Yorgey
On Thu, May 14, 2009 at 03:58:18PM -0300, José Romildo Malaquias wrote: > > Then the resulting of pretty printing the given tree would be something > like the following: > >a >| > +-+ > ||| > bcd > || >+---++---+ >| |

[Haskell-cafe] Haskell Weekly News: Issue 118 - May 16, 2009

2009-05-16 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090516 Issue 118 - May 16, 2009 --- Welcome to issue 118 of HWN, a newsletter covering devel

[Haskell-cafe] ANN: Haskell Hackathon in Philadelphia

2009-05-21 Thread Brent Yorgey
Hi all! We are in the early stages of planning a Haskell hackathon/get together, Hac φ, to be held this summer at the University of Pennsylvania, in Philadelphia. Right now we're looking at two possible dates: June 19-21or July 24-26 If you might be interested in attending, please add y

[Haskell-cafe] Haskell Weekly News: Issue 119 - May 23, 2009

2009-05-23 Thread Brent Yorgey
fusion. New and notable in this release is support for lazy, chunked text, so you can process text files far larger than memory using a small footprint. Haskell Hackathon in Philadelphia. Brent Yorgey [10]announced Hac phi, a Haskell hackathon to be held in Philadelphia in July. Ch

Re: [Haskell-cafe] ANN: Haskell Hackathon in Philadelphia

2009-05-25 Thread Brent Yorgey
more info. -Brent On Sun, May 24, 2009 at 01:35:40PM -0400, Andrew Wagner wrote: > Is there a list of projects that will be worked on during this, or how will > that work? > > On Thu, May 21, 2009 at 5:39 PM, Brent Yorgey wrote: > > > Hi all! > > > > We ar

Re: [Haskell-cafe] Haskell type system and the lambda cube

2009-05-25 Thread Brent Yorgey
On Sun, May 24, 2009 at 10:39:50AM +0200, Petr Pudlak wrote: > On Sun, May 24, 2009 at 12:18:40PM +0400, Eugene Kirpichov wrote: > > Haskell has terms depending on types (polymorphic terms) and types > > depending on types (type families?), but no dependent types. > > But how about undecidability?

Re: [Haskell-cafe] Beginner SOS

2009-05-27 Thread Brent Yorgey
On Wed, May 27, 2009 at 10:39:20AM -0700, Thomas DuBuisson wrote: > Manu, > Did you skip over the dozens of links at haskell.org answering exactly > these questions? There are links to some great tutorials [1] and IRC > information where you can get real-time help [2]. Also there are some > good

[Haskell-cafe] ANNOUNCE: Hac φ: Haskell hackathon in Philadelphia, July 24-26

2009-05-28 Thread Brent Yorgey
Greetings, I am very pleased to officially announce Hac phi, a Haskell hackathon/get-together to be held July 24-26 at the University of Pennsylvania in Philadelphia. The hackathon will officially kick off at 2:30 Friday afternoon, and go until 5pm on Sunday (with breaks for sleep, of course). T

Re: [Haskell-cafe] How to implement this? A case for scoped record labels?

2009-06-01 Thread Brent Yorgey
On Sun, May 31, 2009 at 06:20:23PM -0700, Iavor Diatchki wrote: > > and so on. It is a bit verbose, but you only have to do it once for > your protocol, and then you get the nice overloaded interface. This also seems like the kind of thing perfectly suited to Template Haskell. Especially if the

[Haskell-cafe] Haskell Weekly News: Issue 120 - June 6, 2009

2009-06-06 Thread Brent Yorgey
Haskell hackathon in Philadelphia, July 24-26. Brent Yorgey [23]announced Hac phi, a Haskell hackathon/get-together to be held July 24-26 at the University of Pennsylvania in Philadelphia. The hackathon will officially kick off at 2:30 Friday afternoon, and go until 5pm on Sunday (with

[Haskell-cafe] Hac phi accommodation: register by June 15 for reduced rate!

2009-06-10 Thread Brent Yorgey
Hi all, This is a quick reminder for people interested in attending Hac phi who have not yet reserved a hotel room: if you'd like to reserve a room at Club Quarters at the reduced rate ($114/night single, $129/night double), we ask that you send a note to Daniel Wagner (dan...@wagner-home.com) by

Re: [Haskell-cafe] who's up for a hackathon? (ICFP, late Aug, early Sept)

2009-06-11 Thread Brent Yorgey
On Wed, Jun 10, 2009 at 04:43:57PM +0100, Eric Kow wrote: > Dear Haskellers, > > ICFP 2009 takes place from Monday 31 August to Wednesday 2 September, > with the Haskell Symposium following it on 3 September. > > Would anybody be interested having a Haskell Hackathon during this? My > thinking i

Re: [Haskell-cafe] ghci and applicative

2009-06-12 Thread Brent Yorgey
On Fri, Jun 12, 2009 at 03:00:12PM +0100, Paul Keir wrote: > Thanks Ryan, I'm slowly becoming aware of the effects of Monomorphism. I'll > look > again at Neil Mitchell's blog post. > > I guess it's the same thing when I try: > > > let a = 1 > > a + 1.0 > > I'm taking the "mono" as a clue that

Re: [Haskell-cafe] Wiki user accounts

2009-06-12 Thread Brent Yorgey
On Fri, Jun 12, 2009 at 08:22:25PM +0200, Daniel Fischer wrote: > Am Freitag 12 Juni 2009 18:46:41 schrieb Gwern Branwen: > > There are only 3 bureaucrats/admins; one is a dummy account, one is > > Ashley, and one is John Peterson (who hasn't edited for a year). > > > > One solution would be to hav

[Haskell-cafe] Haskell Weekly News: Issue 121 - June 13, 2009

2009-06-13 Thread Brent Yorgey
ecially be useful for optimizing simple compilers for referentially transparent domain specific languages. Hac phi accommodation: register by June 15 for reduced rate! Brent Yorgey [23]reminded anyone interested in attending [24]Hac phi that Monday 15 June is the deadline for getting

Re: [Haskell-cafe] Re: Wiki user accounts

2009-06-16 Thread Brent Yorgey
On Mon, Jun 15, 2009 at 12:38:02PM -0700, Ashley Yakeley wrote: > Magnus Therning wrote: >> Philippa Cowderoy wrote: >>> On Mon, 2009-06-15 at 13:52 -0400, Gwern Branwen wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Mon, Jun 15, 2009 at 1:18 PM, Ashley Yakeley wrote:

Re: [Haskell-cafe] Slightly off-topic: Lambda calculus

2009-06-21 Thread Brent Yorgey
On Sun, Jun 21, 2009 at 05:53:04PM +0100, Andrew Coppin wrote: > OK, so I'm guessing there might be one or two (!) people around here who > know something about the Lambda calculus. > > I've written a simple interpretter that takes any valid Lambda expression > and performs as many beta reduction

[Haskell-cafe] Haskell Weekly News: Issue 122 - June 21, 2009

2009-06-21 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090621 Issue 122 - June 21, 2009 --- Welcome to issue 122 of HWN, a newsletter covering deve

Re: [Haskell-cafe] Slightly off-topic: Lambda calculus

2009-06-21 Thread Brent Yorgey
On Sun, Jun 21, 2009 at 07:48:30PM +0100, Andrew Coppin wrote: > Andrew Coppin wrote: >> Well anyway, the obvious thing to do is after each reduction, strip off >> all the variable indicies and rerun the labeller to assign new indicies. >> But does this solution work properly in general? > > No.

Re: [Haskell-cafe] Type system trickery

2009-06-22 Thread Brent Yorgey
On Sun, Jun 21, 2009 at 09:16:12PM +0100, Andrew Coppin wrote: > Niklas Broberg wrote: >> That's what GADTs are for: >> >> data Flag = HasZoo | NoZoo >> >> data Foobar a where >> Foo :: Foobar a -> Foobar a >> Bar :: Foobar a -> Foobar a >> Zoo :: Foobar a -> Foobar HasZoo >> > > Ouch #1:

Re: [Haskell-cafe] Reflections on the ICFP 2009 programming contest

2009-06-29 Thread Brent Yorgey
On Mon, Jun 29, 2009 at 11:40:28AM -0700, Justin Bailey wrote: > > Anyways, for those who care, the heart of my VM implementation was a > monadic fold over the program, with a mutable array representing the > machine's memory, all inside ''runSTUArray.'' I used a simple data > type to represent th

[Haskell-cafe] Haskell Weekly News: Issue 123 - June 29, 2009

2009-06-29 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090629 Issue 123 - June 29, 2009 --- Welcome to issue 123 of HWN, a newsletter covering deve

Re: [Haskell-cafe] Monoid wants a (++) equivalent

2009-06-30 Thread Brent Yorgey
On Tue, Jun 30, 2009 at 09:45:45AM -0700, Bryan O'Sullivan wrote: > I've thought for a while that it would be very nice indeed if the Monoid > class had a more concise operator for infix appending than "a `mappend` b". > I wonder if other people are of a similar opinion, and if so, whether this > i

Re: [Haskell-cafe] Monoid wants a (++) equivalent

2009-07-01 Thread Brent Yorgey
On Wed, Jul 01, 2009 at 12:00:50AM -0400, a...@spamcop.net wrote: > G'day all. > > On Tue, Jun 30, 2009 at 08:02:48PM -0400, Daniel Peebles wrote: > >> But we don't want to imply it's commutative either. Having something >> "bidirectional" like <> or <+> feels more commutative than associative >> t

[Haskell-cafe] Haskell Weekly News: Issue 124 - July 4, 2009

2009-07-04 Thread Brent Yorgey
[48]FFI: calling into kernel32.dll. * Greg Bacon: [49]Setting up a simple test with Cabal. * Ketil Malde: [50]Dephd updates. * Bryan O'Sullivan: [51]What's in a text API?. * Brent Yorgey: [52]2009 ICFP programming contest reflections. * Galois, Inc: [53]Galo

Re: [Haskell-cafe] About the return type

2009-07-11 Thread Brent Yorgey
On Thu, Jul 09, 2009 at 10:57:19AM -0400, xu zhang wrote: > I have trouble in returning a list of Figures. I want return a type of m > (Maybe [Figure IO]), but the type of dv_findFigure is :: a -> Point -> s > (Maybe (Figure s)). How can change the code below to get a s (Maybe [Figure > s])? > Than

[Haskell-cafe] Haskell Weekly News: Issue 125 - July 12, 2009

2009-07-12 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090712 Issue 125 - July 12, 2009 --- Welcome to issue 125 of HWN, a newsletter covering deve

Re: Hylomorphisms (was: [Haskell-cafe] excercise - a completely lazy sorting algorithm)

2009-07-12 Thread Brent Yorgey
On Sun, Jul 12, 2009 at 07:01:11PM +0200, Raynor Vliegendhart wrote: > On 7/12/09, Heinrich Apfelmus wrote: > > Raynor Vliegendhart wrote: > > > On 7/9/09, Heinrich Apfelmus wrote: > > >> Of course, some part of algorithm has to be recursive, but this can be > > >> outsourced to a general recursi

[Haskell-cafe] Haskell Weekly News: Issue 126 - July 18, 2009

2009-07-18 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090718 Issue 126 - July 18, 2009 --- Welcome to issue 126 of HWN, a newsletter covering deve

[Haskell-cafe] Haskell Weekly News: Issue 127 - August 8, 2009

2009-08-08 Thread Brent Yorgey
* David Amos: [108]How to count the number of positions of Rubik's cube. * Edward Kmett: [109]Slides from Hac Phi: "All About Monoids". * Brent Yorgey: [110]Primitive species and species operations, part II. * Magnus Therning: [111]Making a choice

[Haskell-cafe] Re: [Hackathon] Edinburgh Meetup (Sat 29 Aug) and Hack Day (Sun 30 Aug)

2009-08-26 Thread Brent Yorgey
On Fri, Aug 14, 2009 at 05:04:00PM +0100, Eric Kow wrote: > Dear Haskellers, > > Just a quick reminder that we will be having a Hack Day in Edinburgh > on Sunday 30 August (ICFP venue). That's in two weeks! > > For the interested, we will also be meeting up the day before 09:30 > Saturday 29 Aug

[Haskell-cafe] Haskell Weekly News: Issue 128 - August 26, 2009

2009-08-26 Thread Brent Yorgey
JSON in Haskell. * Notes on the LHC: [83]Status update: New Integer implementation.. * Edward Kmett: [84]Clearer Reflections. * Petr Rockai: [85]soc final report. * Gergely Patai: [86]hp2any overview online. * Brent Yorgey: [87]New 2D text layout library. * Manuel

Re: [Haskell-cafe] Don't “ accidentallyparallelize”

2009-09-05 Thread Brent Yorgey
On Sat, Sep 05, 2009 at 11:18:24AM +, Gracjan Polak wrote: > > Hi all, > > In "DEFUN 2009: Multicore Programming in Haskell Now!" > (http://donsbot.wordpress.com/2009/09/05/defun-2009-multicore-programming-in-haskell-now/), > slide 30 I see: > > Don't “accidentally parallelize”: > – f `par`

[Haskell-cafe] Haskell Weekly News: Issue 129 - September 5, 2009

2009-09-05 Thread Brent Yorgey
--- Haskell Weekly News http://sequence.complete.org/hwn/20090905 Issue 129 - September 05, 2009 --- Welcome to issue 129 of HWN, a newsletter covering

[Haskell-cafe] Looking for a new HWN editor

2009-09-05 Thread Brent Yorgey
Executive summary: * I'm looking for someone to take over as HWN editor * It is highly automated and doesn't take as much time as you might think (about 3-4 hours/week on average) * You DON'T need to be a Haskell guru * It is far from a thankless job and is a fun way to provide an

[Haskell-cafe] Re: [Haskell] Looking for a new HWN editor

2009-09-05 Thread Brent Yorgey
On Sat, Sep 05, 2009 at 05:26:08PM -0400, Brent Yorgey wrote: > Executive summary: > > * I'm looking for someone to take over as HWN editor > * It is highly automated and doesn't take as much time as you might > think (about 3-4 hours/week on average) > * Yo

[Haskell-cafe] Perl-style numeric type

2007-06-19 Thread Brent Yorgey
Hi all, I've started developing a library to support a "Perl-style" numeric type that "does the right thing" without having to worry too much about types. Explicit static typing of numeric types is really great most of the time, and certainly a good idea for larger projects, but probably everyone

Re: [Haskell-cafe] Perl-style numeric type

2007-06-19 Thread Brent Yorgey
em are quite satisfactory. -- Lennart On 6/19/07, Brent Yorgey <[EMAIL PROTECTED]> wrote: > Hi all, > > I've started developing a library to support a "Perl-style" numeric type > that "does the right thing" without having to worry too much about

Re: [Haskell-cafe] Perl-style numeric type

2007-06-20 Thread Brent Yorgey
On 6/20/07, Henning Thielemann <[EMAIL PROTECTED]> wrote: Do you have some examples, where such a data type is really superior to strong typing? There are examples like computing the average, where a natural number must be converted to a different type: average xs = sum xs / fromIntegral (len

Re: [Haskell-cafe] Perl-style numeric type

2007-06-20 Thread Brent Yorgey
On 6/20/07, Henning Thielemann <[EMAIL PROTECTED]> wrote: How about 1 % floor pi ? Already two examples for the Wiki which I used to start the Wiki article: http://www.haskell.org/haskellwiki/Generic_numeric_type What about the function isSquare? isSquare :: (Integral a) => a -> Bool is

[Haskell-cafe] Re: Perl-style numeric type

2007-06-20 Thread Brent Yorgey
On 6/19/07, Brent Yorgey <[EMAIL PROTECTED]> wrote: I've started developing a library to support a "Perl-style" numeric type that "does the right thing" without having to worry too much about types... So, I just completed my implementation and decided to tes

[Haskell-cafe] Using Template Haskell to automate QuickCheck testing?

2007-06-20 Thread Brent Yorgey
(I originally tried to send this on Jun 8, but it seems that due to various issues it did not actually get sent over the list. Apologies if anyone gets multiple copies.) Hi all, Following some recent discussions in #haskell, I've decided to try my hand at a module to allow automation of QuickCh

Re: [Haskell-cafe] Collections

2007-06-21 Thread Brent Yorgey
> public class Pair { > public A fst; > public B snd; > public Pair(A fst, B snd) { > this.fst = fst; > this.snd = snd; > } > } OK, I don't even understand that syntax. Have they changed the Java language spec or something? Yes. As of version 5 (or 1.5, or whatever you want to

Re: [Haskell-cafe] New New newbie question/help

2007-06-27 Thread Brent Yorgey
Is it proper/ok to defines them as : fromIntegral :: (a::Integral) -> (b::Num) and round :: (a::RealFrac) -> (b::Integral) ? No; Integral, Num and RealFrac are type classes, not types. Think of a type class as a "set of types" which all support certain operations. For example, anything in th

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Brent Yorgey
Is there a reason why the documentation for virtually every module in Control.Monad simply begins with a line that says "Inspired by some paper (http://www.ogi.edu/csee/~mpj/)" It's probably because it was felt that the paper itself is better documentation than anything that could be written

Re: [Haskell-cafe] Sparse documentation

2007-07-03 Thread Brent Yorgey
It's also nice to have some brief comments in the API docs to say what the heck a particular module is even *for*, and provide enough info on the stuff in that module that you can quickly dip into it when you can't remember the name of something... I certainly don't disagree with you! I was ju

Re: [Haskell-cafe] function unique

2007-07-10 Thread Brent Yorgey
The problem with your second implementation is that elements which occur more than once will eventually be included, when the part of the list remaining only has one copy. For example: unique2 [1,1,2,4,1] = unique2 [1,2,4,1] = unique2 [2,4,1] = 2 : unique2 [4,1] = 2 : 4 : unique2 [1] = 2 : 4 : 1

Re: [Haskell-cafe] function unique

2007-07-11 Thread Brent Yorgey
2) The list might be infinite, and your function should work if you make only want to use the first part of it, so the following should return [1,2,3,4,5] in a finite amount of time: take 5 (unique [1..]) I don't think this is possible. Perhaps you misread the original problem description? T

Re: [Haskell-cafe] function unique

2007-07-11 Thread Brent Yorgey
> I don't think this is possible. Perhaps you misread the original problem > description? The unique function is supposed to return a list of those > elements which occur exactly once in the input list, which is impossible to > determine for an infinite input list (the only way to prove that a

Re: [Haskell-cafe] function unique

2007-07-11 Thread Brent Yorgey
On 7/11/07, Alexteslin <[EMAIL PROTECTED]> wrote: Oh, I am lost now - for now anyway. I am attempting to do next exercise in the book to define reverse function using primitive recursion and pattern matching on lists. But getting stack because when i con in front of xs (xs:x) i get en error, w

Re: [Haskell-cafe] Simple newbie question - Int and Integer

2007-07-12 Thread Brent Yorgey
To be more precise, Int represents a machine-sized integer value, so it is limited in size but doing math with Int values translates directly into math on the processor. Integer can store integer values of arbitrary size, which is useful sometimes but is of course a lot slower, since the pieces o

Re: [Haskell-cafe] Lazy Lists and IO

2007-07-12 Thread Brent Yorgey
> Nevertheless, length is a function you should rarely use. > Amen. (I believe the Wiki mentions this concept somewhere... Maybe we should rename it unsafeLength? No, OK, how about... um... slowLength?) It isn't actually slow... how about beSureYouReallyWantIntBeforeUsingThisLength? =) __

[Haskell-cafe] partitions of a multiset

2007-07-23 Thread Brent Yorgey
Hi all, I've written some code to generate set partitions: import Control.Arrow import Data.List -- pSet' S generates the power set of S, with each subset paired -- with its complement. -- e.g. pSet' [1,2] = [([1,2],[]),([1],[2]),([2],[1]),([],[1,2])]. pSet' :: [a] -> [([a],[a])] pSet'

Re: [Haskell-cafe] Another analogy

2007-07-23 Thread Brent Yorgey
On 7/23/07, Andrew Coppin <[EMAIL PROTECTED]> wrote: From the guy who brought you "data in Haskell is like an undead quantum cat", I present the following: "If programming languages were like vehicles, C would be a Ferrari, C++ would be a Porshe, Java would be a BWM and Haskell would be a hover

Re: [Haskell-cafe] Re: partitions of a multiset

2007-07-24 Thread Brent Yorgey
On 7/23/07, DavidA <[EMAIL PROTECTED]> wrote: Here's the approach I would try. 1. Use Data.List.group to group your multiset, eg [1,1,2] -> [[1,1],[2]] 2. Now apply your partitions function to each of the groups [[1,1],[2]] -> [ [([1,1],[]), ([1],[1]), ([],[1,1])], [([2],[]), ([],[2])] ] (Actual

Re: [Haskell-cafe] Re: partitions of a multiset

2007-07-24 Thread Brent Yorgey
On 7/24/07, Pekka Karjalainen <[EMAIL PROTECTED]> wrote: On 7/24/07, Brent Yorgey <[EMAIL PROTECTED]> wrote: > given a list L :: [a], I'm looking for all partitions P :: [[a]] where (sort > . concat $ P) == (sort L). Here is quick attempt that requires Ord [a] and expect

Re: [Haskell-cafe] Printing the function result

2007-07-25 Thread Brent Yorgey
On 7/25/07, Alexteslin <[EMAIL PROTECTED]> wrote: Hi, I am going through examples from the textbook and trying them out but some don't work. For example: addNum :: Int -> (Int -> Int) addNum n = addN where addN m = n+m This error message i am getting: ERROR - Cannot find "sh

Re: [Haskell-cafe] mutually recursive types

2007-08-08 Thread Brent Yorgey
> Notice that Scenario depends on a list of steps and Step has a dependence > with scenario. I know that this is a kind of "bad smell" in Haskell, are > there any pattern or language idiom to deal with cyclical dependences? Just a little something to add, this is not a "bad smell" at all... i

Re: [Haskell-cafe] Slow IO or bad code?

2007-08-09 Thread Brent Yorgey
On 8/9/07, Marc Weber <[EMAIL PROTECTED]> wrote: > > > I wrote a code, but seems to give "Time limit exceeded"! > ?? > Your code writes > 15 to stdout which is correct (with the example given on the page).. > You have to explain what you mean by >>seems to give "Time limit > exceeded"<< > I think

Re: [Haskell-cafe] Slow IO or bad code?

2007-08-09 Thread Brent Yorgey
On 8/9/07, Chaddaï Fouché <[EMAIL PROTECTED]> wrote: > > I get "Wrong answer" with the following code for the same problem... > Is there something strange in this code : This problem description is not worded very well. You have to figure out the matching that maximizes the sum of hotnesses; you

Re: [Haskell-cafe] Operator overloading

2007-08-09 Thread Brent Yorgey
On 8/9/07, rodrigo.bonifacio <[EMAIL PROTECTED]> wrote: > > Hi all. > > I want to overload the operator "^" for working instead of the following > "+++" operator: > > (+++) :: String -> [[String]] -> [[String]] > x +++ y = [ x:e | e<-y ] > > How can I overload the "^" operator? import Prelude hid

Re: [Haskell-cafe] where to put handy functions?

2007-08-09 Thread Brent Yorgey
On 8/9/07, Chad Scherrer <[EMAIL PROTECTED]> wrote: > > > extract :: [Int] -> [a] -> [a] > extract = f 0 > where > f _ _ [] = [] > f _ [] _ = [] > f k nss@(n:ns) (x:xs) = if n == k then x:f (k+1) ns xs > else f (k+1) nss xs > > This behaves roughly as > e

Re: [Haskell-cafe] where to put handy functions?

2007-08-10 Thread Brent Yorgey
On 8/9/07, Chad Scherrer <[EMAIL PROTECTED]> wrote: > > extract :: [Int] -> [a] -> [a] > extract = f 0 > where > f _ _ [] = [] > f _ [] _ = [] > f k nss@(n:ns) (x:xs) = if n == k then x:f (k+1) ns xs > else f (k+1) nss xs Finally, even if no one else is

  1   2   3   4   5   >