categories - Category Theory list
 help / color / mirror / Atom feed
From: Thorsten Altenkirch <txa@Cs.Nott.AC.UK>
To: Robin Cockett <robin@ucalgary.ca>. <categories@mta.ca>
Subject: Re: Functions in programming
Date: Sun, 15 Mar 2009 23:55:32 +0000	[thread overview]
Message-ID: <E1LjMSg-0001L6-87@mailserv.mta.ca> (raw)

> There is one problem, of course: Haskell does not think this is
> legal as
> it thinks all datatypes should have at least one constructor.  (BTW do
> any functional languages allow NO constructors? They really should.)

Yes, Agda does.

> But now we have remembered that initial and final datatypes are
> supposed
> to coincide we have a blinding flash of inspiration:  because ()=1 is
> the final type it must also be the initial object.  So constant
> functions ARE the same as initial functions after all ....... so the
> student was not confused at all!
>
> Or was he?

I think it is a common misunderstanding that because you can write non-
terminating function that you should. Non-termination is a bug and it
is not what functional programming is about.

Btw, Agda is total, but you are allowed to ignore the termination
checker.

Thorsten

>
>
> -robin
>
>
> Robin Cockett, Calgary
>
>
>


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.





             reply	other threads:[~2009-03-15 23:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-15 23:55 Thorsten Altenkirch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-03-21 16:06 Bill Lawvere
2009-03-20 21:18 Robin Cockett
2009-03-19 15:37 Peter Selinger
2009-03-19 15:37 Peter Selinger
2009-03-19 14:18 Peter Selinger
2009-03-19 14:11 MigMit
2009-03-19  2:32 Robin Cockett
2009-03-18 15:34 Bill Lawvere
2009-03-17 23:06 Robin Cockett
2009-03-17  5:17 Nathan Bloomfield
2009-03-16 15:12 Andrew Stacey
2009-03-16 11:37 Miles Gould
2009-03-16  9:27 Tom Hirschowitz
2009-03-16  5:52 Vaughan Pratt
2009-03-16  4:25 Daniel Schüssler
2009-03-15 22:18 Robin Cockett
2009-03-14 19:52 Ellis D. Cooper
2009-03-14 17:39 Thorsten Altenkirch
2009-03-14 14:58 Steve Stevenson
2009-03-14 14:51 Miguel Mitrofanov
2009-03-14  9:51 Luis Barbosa
2009-03-14  6:02 Vaughan Pratt
2009-03-14  3:38 Fred E.J. Linton
2009-03-14  3:22 Michael Shulman
2009-03-14  2:21 Charles Wells
2009-03-13 11:29 Andrew Stacey

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=E1LjMSg-0001L6-87@mailserv.mta.ca \
    --to=txa@cs.nott.ac.uk \
    --cc=robin@ucalgary.ca \
    /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;
as well as URLs for NNTP newsgroup(s).