[Haskell-cafe] Polymorphic (typeclass) values in a list?

2007-10-19 Thread TJ
if I use those, I'll still have to wrap things up in a constructor, won't I? Thanks a bunch, TJ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Polymorphic (typeclass) values in a list?

2007-10-19 Thread TJ
. Thanks everyone. TJ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Polymorphic (typeclass) values in a list?

2007-10-21 Thread TJ
On 10/22/07, Tim Docker [EMAIL PROTECTED] wrote: TJ: After all, sometimes all you need to know about a list is that all the elements support a common set of operations. If I'm implementing a 3d renderer for example, I'd like to have class Renderable a where render

Re: [Haskell-cafe] Polymorphic (typeclass) values in a list?

2007-10-22 Thread TJ
more familiar with basic Haskell98 before I decide on using GHC extensions... Thanks, TJ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Type vs TypeClass duality

2007-10-23 Thread TJ
of Show. Why does this second rate treatment of type classes exist in Haskell? TJ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Type vs TypeClass duality

2007-10-23 Thread TJ
On 10/23/07, Luke Palmer [EMAIL PROTECTED] wrote: On 10/23/07, TJ [EMAIL PROTECTED] wrote: What I find strange is, if we can have functions with hidden parameters, why can't we have the same for, say, elements of a list? Suppose that I have a list of type Show a = [a], I imagine

Re: [Haskell-cafe] Type vs TypeClass duality

2007-10-23 Thread TJ
On 10/23/07, Jules Bean [EMAIL PROTECTED] wrote: Short answer: You are worrying about syntax. The things you want are possible. TJ wrote: Following up on my previous thread, I have figured out why it bothered me that we cannot have a list such as the following: [abc, 123, (1, 2)] :: Show

Re: Uniqueness of principle type? (was Re: [Haskell-cafe] Type vs TypeClass duality)

2007-10-23 Thread TJ
... harsh realities of engineering. Well I hope this is judged to be important enough to be included in a future revision of Haskell. Thanks, TJ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Type vs TypeClass duality

2007-10-23 Thread TJ
:: (a b) - b - SingleList a - SingleList a Nil :: SingleList a Cons has a type variable b in its signature, but no forall. I suppose it comes from the * - * in SingleList's type? That's all I can come up with for now. A great deal of high level coding flying around above my head now. Thanks, TJ

[Haskell-cafe] Beginner: IORef constructor?

2006-11-30 Thread TJ
First of all, sorry if this is a really silly question, but I couldn't figure it out from experimenting in GHCi and from the GHC libraries documentation (or Google). Is there an IORef consturctor? Or is it just internal to the Data.IORef module? I want a global variable, so I did the following:

Re: [Haskell-cafe] Beginner: IORef constructor?

2006-12-01 Thread TJ
Thanks. I've been reading the docs and examples on State (in Control.Monad.State), but I can't understand it at all. ticks and plusOnes... All they seem to do is return their argument plus 1... On 12/1/06, Bernie Pope [EMAIL PROTECTED] wrote: On 01/12/2006, at 6:08 PM, TJ wrote: First of all

Re: [Haskell-cafe] Beginner: IORef constructor?

2006-12-01 Thread TJ
Thanks for the demo. I don't actually understand what's going on yet, but your code doesn't really use a global variable, does it? From what I can understand, the main function is passing the State to the other functions. I think I was careless about mixing IO functions and normal functions.

Re: [Haskell-cafe] Beginner: IORef constructor?

2006-12-01 Thread TJ
++ which screwed up my mind forever ;) Donald: Note that there's no need for any mutable variables here. If this isn't suitable, perhaps you could elaborate a bit on what effect you're trying to achieve? Yes I've come to the same conclusion. Thanks for the help, it really helps :) TJ

[Haskell-cafe] How is laziness defined?

2007-02-04 Thread TJ
. Is that right? What else? This is one of the things that just boggles my mind everytime I try to wrap it around this thing called Haskell ;) Cheers, TJ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell-cafe] How is laziness defined?

2007-02-04 Thread TJ
On 2/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Quoting TJ [EMAIL PROTECTED]: I would think that with 100% laziness, nothing would happen until the Haskell program needed to output data to, e.g. the console. Quite obviously that's not it. So how is laziness defined in Haskell

Re: [Haskell-cafe] How is laziness defined?

2007-02-04 Thread TJ
speaking, not lazy, but non-strict. It being but read and thought about, and not practiced, might prove _itself_ to become Undefined as I evaluate it further. :D Cheers, TJ On 2/5/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: G'day all. tjay.dreaming: So it's just IO which makes things run huh

[Haskell-cafe] State monad in the wikibood article

2007-02-28 Thread TJ
something? (I know the article says that the type for their supposed State monad at that point is not actually correct, and will be clarified further on, but that seems to be irrelevant to my question.) TJ the forever noobie. ___ Haskell-Cafe mailing list

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

2007-03-01 Thread TJ
a bunch mate. Cheers :) TJ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe