Say we have glseq_...<xs><x0>.

The idea is that xs can be treated as the type for a sequence containing
elements of type x.

For 'concat', we may have

fun{xx:vtflt}{xs:vtflt}{x0:vtflt} glseq_concat_stream(xx): stream_vt(x0)

As 'concat' returns a sequence, it can have a eager version (list) and also
a lazy version (stream).
The above one is the stream version. The basic idea is: xx can be seen as a
sequence of xs,
and xs can be seen as a sequence of x0.

I added an implemention in the following directory:

https://github.com/githwxi/ATS-Temptory/blob/master/libats/temp/bucs320/DATS/glseq.dats

BUCS320 is a class I have taught for years. Code put in the above directory
usually do not involve
dependent types (but do involve linear types). Fancier code gets to be put
in libats/temp/bucs520.



On Sun, Jun 2, 2019 at 3:39 PM aditya siram <aditya.si...@gmail.com> wrote:

> Hi,
> I'm working with ATS-Temptory and trying to add a function,
> 'glseq_concat', which generalizes over, for example:
>
>
> fun
> {a:vtflt}
> steam_vt_concat(stream_vt(stream_vt(a))): stream_vt(a)
>
> but I can't find a way of passing in a general type that is parameterized
> in a type. I want to write:
>
> extern fun
> {xs: ...}
> {x: ...}
> glseq_concat
>   (a:xs(xs(x))):xs(x)
>
>
> Is there any way to encode this?
>
> --
> You received this message because you are subscribed to the Google Groups
> "ats-lang-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ats-lang-users+unsubscr...@googlegroups.com.
> To post to this group, send email to ats-lang-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/ats-lang-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ats-lang-users/b3fdf7fc-0a2e-4f86-8eb6-8a084330f518%40googlegroups.com
> <https://groups.google.com/d/msgid/ats-lang-users/b3fdf7fc-0a2e-4f86-8eb6-8a084330f518%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLoTEPyN0S6O-hACHUq0fE8iTGE7qhW_%2BRVLnvGZkp6DmQ%40mail.gmail.com.

Reply via email to