Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.haskell > #209

Re: sell me on strong typing, type safety, etc.

From "Mark T. B. Carroll" <mtbc@bcs.org>
Newsgroups comp.lang.haskell
Subject Re: sell me on strong typing, type safety, etc.
Date 2012-04-06 22:17 -0400
Organization none
Message-ID <87k41sffp3.fsf@ixod.org> (permalink)
References (8 earlier) <fc414e4d-325c-4c74-9d96-ae7e7edfac30@px4g2000pbc.googlegroups.com> <11121860.1045.1333615360100.JavaMail.geo-discussion-forums@vbtv42> <93eeaa84-87e1-445d-bcb4-a1ee394ad5bb@a8g2000pbe.googlegroups.com> <2761773.849.1333726377020.JavaMail.geo-discussion-forums@ynbj3> <cc5042cf-0f4f-4b66-bca4-6e6a55e0a04e@vy9g2000pbc.googlegroups.com>

Show all headers | View raw


ultranewb <pineapple.link@yahoo.com> writes:

> But Haskell can apparently only handle homogeneous lists, I assume
> because of the strong typing.  The point of my erlang example was,
> dynamic typing can handle lists of truly unknown stuff, where the list
> could be a hodge-podge of anything.

But, in actual real-world programs, given that we also have fixed-length
tuples, heterogeneous lists very rarely crop up; sum types, and type
class restrictions, cover typical needs. Haskell /can/ handle
heterogeneous lists using tricks with existential types and suchlike --
for instance, see http://homepages.cwi.nl/~ralf/HList/paper.pdf -- and I
think I once made use of that kind of technique, but the need just
doesn't usually come up. Lists typically aren't just a "hodge-podge of
anything" unless the type system wasn't expressive enough, like lacking
good algebraic types, to say truly what the useful thing is that the
list's elements have in common. Even when one's serializing and
deserializing one normally has lists of bytes or legal datastructure
elements or something. At least, a quick glance through the code I've
written suggests that, at most, I've used functional dependencies to
constrain what kinds of things I have in homogeneous lists passed to the
same function, relative to each other (so, to take an odd but possibly
illustrative example, if the first argument lists hippos, then the
second must have cats, or something), but I'm just not managing to
imagine the motivating example for these truly hodge-podge lists given
sufficiently expressive typing.

Mark

Back to comp.lang.haskell | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-03-30 09:53 -0700
  Re: sell me on strong typing, type safety, etc. John Coleman <jcoleman@franciscan.edu> - 2012-03-31 06:25 -0700
    Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-03-31 11:57 -0700
  Re: sell me on strong typing, type safety, etc. ingo.wechsung@googlemail.com - 2012-04-01 08:23 -0700
    Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-04-01 13:35 -0700
      Re: sell me on strong typing, type safety, etc. ingo.wechsung@googlemail.com - 2012-04-02 03:51 -0700
        Re: sell me on strong typing, type safety, etc. Roman W <bloody_rabbit@gazeta.pl> - 2012-04-02 04:31 -0700
    Re: sell me on strong typing, type safety, etc. dvandeun@wilma.vub.ac.be (Dirk van Deun) - 2012-04-03 09:13 +0000
      Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-04-03 11:00 -0700
  Re: sell me on strong typing, type safety, etc. Roman W <bloody_rabbit@gazeta.pl> - 2012-04-02 02:03 -0700
    Re: sell me on strong typing, type safety, etc. ingo.wechsung@googlemail.com - 2012-04-02 03:30 -0700
      Re: sell me on strong typing, type safety, etc. Roman W <bloody_rabbit@gazeta.pl> - 2012-04-02 04:28 -0700
        Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-04-02 12:17 -0700
          Re: sell me on strong typing, type safety, etc. Roman W <bloody_rabbit@gazeta.pl> - 2012-04-03 06:58 -0700
            Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-04-03 10:58 -0700
              Re: sell me on strong typing, type safety, etc. Paul Rubin <no.email@nospam.invalid> - 2012-04-03 12:07 -0700
                Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-04-03 13:44 -0700
                Re: sell me on strong typing, type safety, etc. Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2012-04-03 20:01 -0300
                Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-04-04 12:10 -0700
              Re: sell me on strong typing, type safety, etc. Roman W <bloody_rabbit@gazeta.pl> - 2012-04-04 03:32 -0700
                Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-04-04 09:37 -0700
                Re: sell me on strong typing, type safety, etc. Roman W <bloody_rabbit@gazeta.pl> - 2012-04-04 09:43 -0700
                Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-04-04 11:11 -0700
                Re: sell me on strong typing, type safety, etc. Roman W <bloody_rabbit@gazeta.pl> - 2012-04-05 01:42 -0700
                Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-04-06 08:22 -0700
                Re: sell me on strong typing, type safety, etc. ingo.wechsung@googlemail.com - 2012-04-06 08:32 -0700
                Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-04-06 18:29 -0700
                Re: sell me on strong typing, type safety, etc. Paul Rubin <no.email@nospam.invalid> - 2012-04-06 18:44 -0700
                Re: sell me on strong typing, type safety, etc. ultranewb <pineapple.link@yahoo.com> - 2012-04-06 18:32 -0700
                Re: sell me on strong typing, type safety, etc. "Mark T. B. Carroll" <mtbc@bcs.org> - 2012-04-06 22:17 -0400

csiph-web