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
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
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
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
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;
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
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
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
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
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
. 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
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
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
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
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
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
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
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
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
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
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
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
> 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
23 matches
Mail list logo