Thanks for all the responses. They were indeed very helpful.
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
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
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.
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
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
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
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
> 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
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
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
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 :-)
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] -
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/~
>= 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
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
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
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
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
18 matches
Mail list logo