marlenemiller71 | 20 Nov 23:57
Favicon

Re: let binding ()

> In both cases, the reason is that exhaustiveness checking is based
> only on the type of the expression, not on its value.

Is it correct to explain let-binding for this syntax

let <pattern> = <expression1> in <expression2>

as the type inference mechanism computes type T1 of <pattern> and type
T2 of <expression1> inferring the type of variables in <pattern> using
T2, and then T1 must be the same as T2?

__._,_.___
Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Search Ads

Get new customers.

List your web site

in Yahoo! Search.

Health Groups

for people over 40

Join people who are

staying in shape.

.

__,_._,___
Jon Harrop | 21 Nov 01:57
Favicon

Re: let binding ()

On Thursday 20 November 2008 22:57:13 marlenemiller71 wrote:
> > In both cases, the reason is that exhaustiveness checking is based
> > only on the type of the expression, not on its value.
>
> Is it correct to explain let-binding for this syntax
>
> let <pattern> = <expression1> in <expression2>
>
> as the type inference mechanism computes type T1 of <pattern> and type
> T2 of <expression1> inferring the type of variables in <pattern> using
> T2, and then T1 must be the same as T2?

Essentially, yes. Note that "T1 must be the same as T2" should strictly be "T1
is unified with T2".

I found it very instructive to implement a simple type inferencer in OCaml, to
understand how type inference works. That gives you a much better idea of how
to interpret type errors when things go wrong in OCaml as well.

--
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e

__._,_.___
Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Yahoo! Groups

Everyday Wellness Zone

Check out featured

healthy living groups.

All-Bran

Day 10 Club

on Yahoo! Groups

Feel better with fiber.

.

__,_._,___
marlenemiller71 | 21 Nov 06:30
Favicon

Re: let binding ()

> I found it very instructive to implement a simple type inferencer in
OCaml, to
> understand how type inference works. That gives you a much better
idea of how
> to interpret type errors when things go wrong in OCaml as well.

Ok.

__._,_.___
Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

New web site?

Drive traffic now.

Get your business

on Yahoo! search.

Yahoo! Groups

Going Green Zone

Learn to go green.

Save energy. Save the planet.

.

__,_._,___

Gmane