Re: type equivalency

2002-06-05 Thread Cagdas Ozgenc
Thanks for all the responses. They were indeed very helpful. ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: type equivalency

2002-06-05 Thread Tom Pledger
Andrew J Bromage writes: | G'day all. | | On Wed, Jun 05, 2002 at 10:35:52PM -0500, Jon Cast wrote: | | > > One general rule of strongly-typed programming is: A program is type | > > correct if it is accepted by my favourite type checker. A corollary | > > is that what you call a type, I

Re: type equivalency

2002-06-05 Thread Andrew J Bromage
G'day all. On Wed, Jun 05, 2002 at 10:35:52PM -0500, Jon Cast wrote: > > One general rule of strongly-typed programming is: A program is type > > correct if it is accepted by my favourite type checker. A corollary > > is that what you call a type, I reserve the right to call a > > precondition.

Re: type equivalency

2002-06-05 Thread Jon Cast
Andrew J Bromage <[EMAIL PROTECTED]> wrote: > G'day all. > On Wed, Jun 05, 2002 at 08:20:03PM -0500, Jon Cast wrote: > > I think you're confused about what the type declarations mean. > > When you say > > > sqrt :: Float -> Float > > you're promising to operate over /all/ Floats. > That wou

Re: type equivalency

2002-06-05 Thread Andrew J Bromage
G'day all. On Wed, Jun 05, 2002 at 08:20:03PM -0500, Jon Cast wrote: > I think you're confused about what the type declarations mean. When > you say > > > sqrt :: Float -> Float > > you're promising to operate over /all/ Floats. That would be true of Haskell functions were constrained to be

Re: type equivalency

2002-06-05 Thread Jon Cast
Cagdas Ozgenc <[EMAIL PROTECTED]> wrote: > For example all functions with Int -> Int are type equivalent, > because structural equivalency is used. Most of the time the > functions are not compatible because they have different pre/post > conditions, even though they seem to have the same input o

Re: type equivalency

2002-06-05 Thread Alastair Reid
I remain puzzled by the thrust of your argument however one bit did make sense: > Also a function working over (Int,Int) will do so even if the > numbers are totally irrelevant to that function. They maybe the > number of (apples,oranges) or number of (books,authors). It sounds like you want di

Re: type equivalency

2002-06-05 Thread Jon Fairbairn
> For example all functions with Int -> Int are type equivalent > However, > > data D a b = MkD a b All objects D Int Int are type equivalent. I'm not sure what your question means, otherwise. If you define data Function a b = F (a -> b) apply:: Function a b -> a -> b apply (F f) a = f a y

Re: type equivalency

2002-06-05 Thread Cagdas Ozgenc
For example all functions with Int -> Int are type equivalent, because structural equivalency is used. Most of the time the functions are not compatible because they have different pre/post conditions, even though they seem to have the same input output types. I rather make my functions an instanc

type equivalency

2002-06-05 Thread Tom Pledger
Cagdas Ozgenc writes: | Greetings. | | I know 2 special type constructors(there might be other that I do | not know yet) -> and ( , ) where structural type equivalency is | enforced and we can also create new types with an algebric type | constructor notation where name equivalency is enfor

Re: Counting occurrences question

2002-06-05 Thread Andy Fugard
At 20:11 05/06/2002 +0200, Hannah Schroeter wrote: >Why not combine filter and length appropriately? Pass -- I'm also a newbie, and haven't got as far as filter. *Looks up filter* Well, there's his homework done :-)

Re: Counting occurrences question

2002-06-05 Thread Hannah Schroeter
Hello! On Wed, Jun 05, 2002 at 07:04:28PM +0100, Andy Fugard wrote: > >= Original Message From "xoo" <[EMAIL PROTECTED]> = > >hi.. i was just wondering if some body could give a simple equation for the > following situation.other than recursion plz.. > >occurrences :: Eq a => a -> [a] -

RE: Counting occurrences question

2002-06-05 Thread Hal Daume III
Probably is a homework question, so HINT: you can do it using 2 and only 2 prelude functions and no additional function definitions of your own. -- Hal Daume III "Computer science is no more about computers| [EMAIL PROTECTED] than astronomy is about telescopes." -Dijkstra | www.isi.edu/~

RE: Counting occurrences question

2002-06-05 Thread Andy Fugard
>= Original Message From "xoo" <[EMAIL PROTECTED]> = >hi.. i was just wondering if some body could give a simple equation for the following situation.other than recursion plz.. > >occurrences :: Eq a => a -> [a] -> [a] >--occurrences xs ys returns the number of times that xs occurs in ys

type equivalency

2002-06-05 Thread Cagdas Ozgenc
Greetings.   I know 2 special type constructors(there might be other that I do not know yet) -> and ( , )  where structural type equivalency is enforced and we can also create new types with an algebric type constructor notation where name equivalency is enforced.   What is the rationale? I m

(no subject)

2002-06-05 Thread xoo
hi.. i was just wondering if some body could give a simple equation for the following situation.other than recursion plz..   occurrences :: Eq a => a -> [a] -> [a] --occurrences xs ys returns the number of times that xs  occurs in ys     thanks

Bilgisayar Egitiminde Bir Numara

2002-06-05 Thread Sertifikam.Com
 Sertifikam.Com Bilgisayar Eðitim MerkeziMicrosoft Certified Systems EngineerMicrosoft Certified Systems AdministratorMicrosoft Certified Database AdministratorMicrosoft Office User Web Designer Super Fiyatlar ! Ve http://www.sertifikam.com adresinden KAYIT olanlara %10 indirim

Bilgisayar Egitiminde Bir Numara

2002-06-05 Thread Sertifikam.Com
 Sertifikam.Com Bilgisayar Eðitim MerkeziMicrosoft Certified Systems EngineerMicrosoft Certified Systems AdministratorMicrosoft Certified Database AdministratorMicrosoft Office User Web Designer Super Fiyatlar ! Ve http://www.sertifikam.com adresinden KAYIT olanlara %10 indirim