Re: State monads don't respect the monad laws in Haskell

2002-05-14 Thread Jay Cox
Seq has to do with changing the order of operations, which I'm trying to say also changes strictness properties. Ugh. I swear they're all related somehow, I just can't grasp all of it at the moment. Appologies if my message seems rather incoherent. I thought about not sending

Re: Confused about seq and forms.

2002-04-12 Thread Jay Cox
nis Janis Voigtlaender's message. I'd post it all if I weren't afraid that might offend you for some reason or violate some implicit politeness law I don't know of. Thanks both, Jay Cox ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Gratitude message (lazy evaluation etc. document.)

2002-04-11 Thread Jay Cox
On Thu, 11 Apr 2002, Jay Cox wrote: > I still am trying to write a document about strictness and haskell > evaluation for those of us without research degrees ;-) Just to say something quick. There are a few of you that actually responded when I was going to write what I then cal

Confused about seq and forms.

2002-04-11 Thread Jay Cox
I really, really want that reference to at least read that bit about WHNF. However, I'd love any correction or verefication of my thinking process. Thanks, Jay Cox ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Double -> non-double function :)

2002-04-03 Thread Jay Cox
his. >import Storable >import MarshalAlloc >import Ptr > >main = print "hello" Main> do x<-(malloc::IO (Ptr Double)); poke x 3; y<-peek x; let z=(castPtr x)::Ptr Int in do poke z 1024; z'<-peek x;

On the subject of monads (was Re: ">>" and "do" notation)

2002-03-31 Thread Jay Cox
st 2, in otherwords, every element in list2 is in list2, and visa versa. So, assuming I had that proof, what would I call this? a non associative monad? a psuedo-monad? a quasi-monad? A funky-monkey-monad? I mean, I have heard of non-associative algebras or what-not, why cant monads have the same

Re: Strictness

2002-03-15 Thread Jay Cox
p f [] = [] map f (x:xs) = f x : map f xs f can be bottom easily. take length $ map _|_ [1..5] for example. (for your pretend bottom, you could use error, as in bottom = error "I'm _|_!") This is quite intriguing. I've learned something today. I hope my post proves usefu

Re: Strictness!

2002-03-14 Thread Jay Cox
amp; strict y = ... > f x y | all strict [x,y] = ... > > Of course, with the second example x and y must have the same type. > Hope this helps. > > - Brian Huffman Thanks! that looks like a great haskell idiom to use! Jay Cox ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Strictness (was: Is this tail recursive?)

2002-03-14 Thread Jay Cox
ies. The embarrasing thing (for me) is that I'm ON the Clean mailing list! I should have known or remembered about clean's strictness annotations, though I really haven't ever coded anything in it. I intend to read anything those Clean(ers) happen to have on the subject. Cheers, Jay

Strictness (was: Is this tail recursive?)

2002-03-13 Thread Jay Cox
uld have type b ->!a ->c and then there might be times when you want to ah, lazify, a strict function. maybe that would be taken care of by giving the type without the strictness annotation (explicitly giving the type but removing all "!") How about it? Has there been any other p

Re: Isn't this tail recursive?

2002-03-12 Thread Jay Cox
. I tried that in ghc 5.00 and in fact ghc is smart enough to detect bottom here! It says >[jay@localhost haskell]$ ./a.out > >Fail: <> awesome! I feel like I am rambling to no end. alright. I hope I haven't been too confusing here. All in all I do like your explanation thou

Re: type aliases in instances

2002-03-11 Thread Jay Cox
r example, what if I wanted to use some alias for an arbitrary tuple? The type checker cannot tell the difference between the aliased type and the other, which means you cannot make the two instances type Alias1 =Type1 instance Foo Type1 where ... instance Foo Alias1 where ... Which you dearly might if you wanted to interpet your conception of what your type alias "means" into your program. That's probably why newtype was invented. Jay Cox ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Isn't this tail recursive?

2002-03-10 Thread Jay Cox
gma. nhc98's mechanism is >{-# OPTIONS_COMPILE -nkpat ... etc #-} >anywhere in the file, which has no restrictions on the options it >accepts - you can use anything that can appear on the commandline. o just maybe you could exchange -fall-strict for

Re: how to read a file's content to a string?

2002-03-05 Thread Jay Cox
p://haskell.org/wiki/wiki?ThatAnnoyingIoType UsingIo: What's that IO type anyway? How do I do I/O in Haskell? http://haskell.org/wiki/wiki?UsingIo Jay Cox ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Lazy Evaluation

2002-03-04 Thread Jay Cox
had a discussion about something very similar to this a few months ago on some haskell.org list. Thanks, Jay Cox ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Standard Library report: List union

2002-03-04 Thread Jay Cox
By eq) first_ulist list_of_lists foldr (unionBy' eq) first_ulist list_of_lists So, is there aother reason I cannot think of? I'm sure I haven't covered all bases here. Thanks, Jay Cox ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: forcing IO operations

2002-02-20 Thread Jay Cox
nad can do anything liftIOtoMyMonad_ can handle. Essentially liftIOtoMyMonad_ = liftIOtoMyMonad but with a much more restrictive type) Jay Cox ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: forcing IO operations

2002-02-20 Thread Jay Cox
e for Gofer, the Haskell precursor, I decided to modernize it a bit. By the way, seems like there might be something along the lines of this in the hugs library. (If not, I'm sure I remember something about reader and writer monad wrappers) Jay Cox [1]written by John Hughes & Magnus Carlson

Re: ideas for compiler project

2002-02-17 Thread Jay Cox
ement something like this in > Haskell? Or is it better to make a small interpreted language? > > Best, > Dylan Thurston > why not write some software that does something like let y = ((Matrix A) :*: (Vector X)) := (Matrix B)) data MatrixEx

Re: [Newbie] Programming with MArray

2002-02-09 Thread Jay Cox
s right then if your type "a" doesnt have "Enum a" and (Eq "a" or Ord "a") instance, it looks like iterating over a list is the only solution. Jay Cox ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Compiler problem or dumb mistake?

2002-02-03 Thread Jay Cox
redictable you did make sure to use the pragma that says NOT to inline checkWid? btw, your original map function could possibly be better written as a zipWith as in.. zipWith (\w s -> checkWid ShowList w s) widNodes [0..] zipWith is mentioned in the Prelude and is a fairly widely used high

Explicit Universal Quantification Bug?

2002-01-24 Thread Jay Cox
99 >module Dummy where > >import ST > >newtype TIM s a = TIM (ST s (Maybe a)) > >runTIM :: (forall s. TIM s a) -> Maybe a >runTIM t = runST (deTIM t) > >deTIM (TIM t) = t so, is using a pattern matching function the truly accepted

Re: Counting Constructors

2001-07-18 Thread Jay Cox
> From: Tobias Haeberlein <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: Counting Constructors > > I want a show - instance for that type: > data Bind a = Zero | Succ a > resp. for the types (Bind ( ... (Bind a)...)) > > showing the following: > > show (Succ ( ... (Succ