From: John Max Skaller <skaller@ozemail.com.au>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Turning off type-checking
Date: Thu, 16 May 2002 05:42:32 +1000 [thread overview]
Message-ID: <3CE2BA27.6030808@ozemail.com.au> (raw)
In-Reply-To: <20020514125133.GC15675@kiefer.ai.univie.ac.at>
Markus Mottl wrote:
>
>---------------------------------------------------------------------------
>let model meal_d1 =
> let satisfaction_c1 =
> (match meal_d1 with
> | TapirSoup spiced_d1 ->
> (match spiced_d1 with
> | True -> Low
> | False -> High)
> | Pizza (_, spiced_d1, topping_d1) ->
> let satisfaction_c1 =
> (match spiced_d1 with
> | True ->
> (match topping_d1 with
> | Cheese sort_d1 ->
> (match sort_d1 with
> | Gorgonzola -> Low
> | Mozzarella -> High)
> | _ -> High)
> | False -> Low) in
> Very satisfaction_c1
> | WienerSchnitzel _ -> Low) in
> Very satisfaction_c1
>---------------------------------------------------------------------------
>
>If there are, say, mappings from 100 to 100 variables and thousands of
>deeply structured sample values (a "real-world" problem), the models
>can look quite terrifying.
>
Hmm. The standard programmers trick here is to lift out the
nested components, at the cost of passing the environment as
arguments: if you type the arguments, it short circuits inference.
BTW: you can encode the "Very" recursion as an integer.
For some models .. eg the model is a grammar and the
data is a program with output a parse tree .. this optimisation
isn't useful .. but in the 'real' world a lot of data is scalar
rather than recursive.
--
John Max Skaller, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
next prev parent reply other threads:[~2002-05-15 19:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-14 3:10 Gregory Morrisett
2002-05-14 7:10 ` Francois Pottier
2002-05-14 7:56 ` eijiro_sumii
2002-05-14 12:51 ` Markus Mottl
2002-05-15 19:42 ` John Max Skaller [this message]
2002-05-15 21:02 ` Markus Mottl
2002-05-14 8:20 ` Alain Frisch
2002-05-14 10:33 ` Christophe Raffalli
2002-05-14 13:39 ` Oliver Bandel
2002-05-15 6:00 ` malc
-- strict thread matches above, loose matches on Subject: below --
2002-05-13 13:31 Markus Mottl
2002-05-13 14:33 ` Lauri Alanko
2002-05-13 21:47 ` Berke Durak
2002-05-14 13:33 ` Oliver Bandel
2002-05-14 14:33 ` Jacques Garrigue
2002-05-14 23:17 ` Markus Mottl
2002-05-14 23:34 ` John Prevost
2002-05-15 8:51 ` Jacques Garrigue
2002-05-15 22:22 ` John Max Skaller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3CE2BA27.6030808@ozemail.com.au \
--to=skaller@ozemail.com.au \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox