[Agda] list of types

Altenkirch Thorsten psztxa at exmail.nottingham.ac.uk
Mon Apr 15 16:33:32 CEST 2013


Actually, I think the type you have in mind is

data EachPositive (xs : List Nat) where
	[] : EachPositive []
	_::_ : forall {n} (EachPositive xs) -> EachPositive (n :: xs)

which isn't the same same as "map (\ n -> n > 0) xs" which is just a list
of types. 

Another way would be to (fold \times \top) on this list to get a type
(replacing nil by \top and :: by \times. But I think the dependent type
given above is preferable.

Thorsten



On 15/04/2013 10:24, "Altenkirch Thorsten"
<psztxa at exmail.nottingham.ac.uk> wrote:

>Indeed, what would be an element of "EachPositive xs"?
>
>On 15/04/2013 06:17, "Andreas Abel" <andreas.abel at ifi.lmu.de> wrote:
>
>>On 15.04.2013 11:44, Serge D. Mechveliani wrote:
>>> Andreas Abel responded recently
>>>
>>>> A list of types is not a type.
>>>
>>> But why
>>>         EachPositive : List Nat -> List (Set _)
>>>         EachPositive xs =  map (\ n -> n > 0) xs
>>>
>>> is type-checked?
>>
>>This is fine, "List Set" is a type, but "EachPositive xs" is a list, and
>>cannot be used as a type, as in,
>>
>>   -> EachPositive xs -> ...
>>
>>
>>
>>
>>-- 
>>Andreas Abel  <><      Du bist der geliebte Mensch.
>>
>>Theoretical Computer Science, University of Munich
>>Oettingenstr. 67, D-80538 Munich, GERMANY
>>
>>andreas.abel at ifi.lmu.de
>>http://www2.tcs.ifi.lmu.de/~abel/
>>_______________________________________________
>>Agda mailing list
>>Agda at lists.chalmers.se
>>https://lists.chalmers.se/mailman/listinfo/agda
>
>This message and any attachment are intended solely for the addressee and
>may contain confidential information. If you have received this message
>in error, please send it back to me, and immediately delete it.   Please
>do not use, copy or disclose the information contained in this message or
>in any attachment.  Any views or opinions expressed by the author of this
>email do not necessarily reflect the views of the University of
>Nottingham.
>
>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.
>_______________________________________________
>Agda mailing list
>Agda at lists.chalmers.se
>https://lists.chalmers.se/mailman/listinfo/agda

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

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.


More information about the Agda mailing list