🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.functional
Article #490

Re: A question about types in ML

#490
From: Fraser Wilson
Date: Mon, 12 Nov 1990 08:36
19 lines
1308 bytes
In <paula.658247771@shum> paula@SHUM.HUJI.AC.IL (Paula Ross) writes:

>Is there any way in ML that you can create a data type which accepts
>sequences of objects of different types (when the number and types of the
>objects are not known in advance) ?
>i.e. can you create a list type without the restriction that each element of
>the list must be of the same type ?

As far as I know you can only do this using a union type, which means
you have to know what types you will get.  I don't think it can be done
for an arbitary type.


Fraser Wilson			| Of all the knights in Appledore
fraser@bilby.cs.uwa.oz		| The bravest was Sir Thomas Tom
				| He multiplied as far as four
There can be only one!		| And knew what nine was taken from
	- CM			| To make eleven.  He could write
				| A letter to another knight.	- A.A Milne
Technical Details
Message-ID: <fraser.658398987@melomys>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!munnari.oz.au!uniwa!bilby.cs.uwa.oz.au!melomys!fraser
References: <paula.658247771@shum>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!munnari.oz.au!uniwa!bilby.cs.uwa.oz.au!melomys!fraser
From: fraser@bilby.cs.uwa.oz.au (Fraser Wilson)
Newsgroups: comp.lang.functional
Subject: Re: A question about types in ML
Message-ID: <fraser.658398987@melomys>
Date: 12 Nov 90 08:36:27 GMT
References: <paula.658247771@shum>
Distribution: comp
Organization: Dept. Computer Science, University of Western Australia.
Lines: 19