Re: Consume all linear props of a given form in the environment?

2019-06-02 Thread Shimin Guo
Interesting, anything you can share about your prolog-based approach?
Sounds like I finally have an excuse to learn prolog :)

On Sun, Jun 2, 2019 at 7:46 PM Chris Double 
wrote:

> On Sun, Jun 2, 2019 at 10:24 AM Shimin Guo  wrote:
> > I think I should say more about my motivation. In my day-to-day work, we
> often need to set up server hosts, and we use ansible to do that. There are
> other tools like Chef, SaltStack, etc., that are all similar. With these
> tools, instead of using shell commands, we can use commands that are
> higher-level, more declarative, and idempotent, such as "path /a/b/c should
> exist", "file xyz should have this content", "package foo should be
> installed", etc. While definitely an improvement over shell scripting, they
> still leave a lot to be desired. Specifically, I'd like to be able to
> > - reason about the state of the system after a sequence of commands are
> run, and
> > - state formally what a sequence of commands should accomplish.
>
> I also use Ansible in my daily work and have desired a more type safe
> way of handling deployment, etc. I'm very interested in seeing what
> you come up with. I ended up exploring a more prolog-like solution,
> but would still like to see what's possible in the typed world. I went
> for prolog to solve the problem of "Here is system in state A", "here
> is my target state, B", search for the optimal commands to run that
> take the system from A to B.
>
> An approach I was considering doing was having an ATS program generate
> an ansible playbook when run. So instead of writing error prone
> Ansible/Python, write ATS which checks the types like your examples,
> and when run it produces the Ansible playbook.
>
> --
> http://bluishcoder.co.nz
>
> --
> 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/CALn1vHFgf83RgKYTDfBvNzt217zcOqN99cwAQPTtOrqJce-%3Dnw%40mail.gmail.com
> .
>

-- 
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/CAA6Z%2B7DsfnTT-CQQcTr7Y3SnyHVSdskQ_aM8wvs3Wto2NuxohQ%40mail.gmail.com.


Re: Temptory Docs Website

2019-06-02 Thread Brandon Barker
Amazing, and the ditto for the new combinator API.

On Sun, Jun 2, 2019 at 10:25 PM Richard  wrote:

> Hello all,
>
> Just a sneak peak of something I have been working on for documenting
> ATS-Temptory.
>
> https://sparverius.github.io/tmplats-doc/
>
> - Richard
>
> --
> 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/6a68507a-bb2e-4e80-a560-089c3d6bf81e%40googlegroups.com
> .
>


-- 
Brandon Barker
brandon.bar...@gmail.com

-- 
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/CAORbNRoQawpaOmnjocEk4Ht1Jf2qc26AeECjSVM3_zx13PvzQg%40mail.gmail.com.


Re: Consume all linear props of a given form in the environment?

2019-06-02 Thread Chris Double
On Sun, Jun 2, 2019 at 10:24 AM Shimin Guo  wrote:
> I think I should say more about my motivation. In my day-to-day work, we 
> often need to set up server hosts, and we use ansible to do that. There are 
> other tools like Chef, SaltStack, etc., that are all similar. With these 
> tools, instead of using shell commands, we can use commands that are 
> higher-level, more declarative, and idempotent, such as "path /a/b/c should 
> exist", "file xyz should have this content", "package foo should be 
> installed", etc. While definitely an improvement over shell scripting, they 
> still leave a lot to be desired. Specifically, I'd like to be able to
> - reason about the state of the system after a sequence of commands are run, 
> and
> - state formally what a sequence of commands should accomplish.

I also use Ansible in my daily work and have desired a more type safe
way of handling deployment, etc. I'm very interested in seeing what
you come up with. I ended up exploring a more prolog-like solution,
but would still like to see what's possible in the typed world. I went
for prolog to solve the problem of "Here is system in state A", "here
is my target state, B", search for the optimal commands to run that
take the system from A to B.

An approach I was considering doing was having an ATS program generate
an ansible playbook when run. So instead of writing error prone
Ansible/Python, write ATS which checks the types like your examples,
and when run it produces the Ansible playbook.

-- 
http://bluishcoder.co.nz

-- 
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/CALn1vHFgf83RgKYTDfBvNzt217zcOqN99cwAQPTtOrqJce-%3Dnw%40mail.gmail.com.


Re: Temptory Docs Website

2019-06-02 Thread Artyom Shalkhakov
Hi Richard,

Awesome, thank you so much for doing this!

What help do you need?

On Mon, Jun 3, 2019, 05:25 Richard  wrote:

> Hello all,
>
> Just a sneak peak of something I have been working on for documenting
> ATS-Temptory.
>
> https://sparverius.github.io/tmplats-doc/
>
> - Richard
>
> --
> 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/6a68507a-bb2e-4e80-a560-089c3d6bf81e%40googlegroups.com
> .
>

-- 
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/CAKO6%3DqizMM5QsrjLqD2JvGFoT5dFTCRnoam4GXbUhhk2wjkY4A%40mail.gmail.com.


Temptory Docs Website

2019-06-02 Thread Richard
Hello all,

Just a sneak peak of something I have been working on for documenting 
ATS-Temptory.

https://sparverius.github.io/tmplats-doc/

- Richard

-- 
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/6a68507a-bb2e-4e80-a560-089c3d6bf81e%40googlegroups.com.


Re: Implementing glseq_concat

2019-06-02 Thread gmhwxi

sexpdef was called stadef. Both in ATS2. Higher-kinded types are not 
difficult
to handle if we box everything like in Haskell. But using higher-kinded 
types as
template parameters poses a significant challenge. Will attempt to address 
it in
ATS3.

On Sunday, June 2, 2019 at 8:49:49 PM UTC-4, aditya siram wrote:
>
> Oh wow, I just looked it up and I guess 'sexpdef' is new as of ATS3 and 
> allows higher-kinded types. Neat!
>
>
> On Sunday, June 2, 2019 at 7:31:57 PM UTC-5, gmhwxi wrote:
>>
>> Sorry, misunderstood. Here is another try:
>>
>>
>> #staload
>> "libats/SATS/list_vt.sats"
>> #staload
>> "libats/SATS/stream_vt.sats"
>>
>> extern
>> fun
>> {xx:vtflt}
>> {xs:vtflt}
>> {x0:vtflt}
>> gseq_concat(xx): xs
>>
>> local
>> sexpdef f = list0_vt
>> in
>> impltmp
>> (a:vtflt)
>> gseq_concat(xx) = list0_vt_concat(xx)
>> end // local
>>
>> local
>> sexpdef f = stream_vt
>> in
>> impltmp
>> (a:vtflt)
>> gseq_concat(xx) = stream_vt_concat(xx)
>> end // local
>>
>> On Sun, Jun 2, 2019 at 8:12 PM aditya siram  wrote:
>>
>>>
>>> Ah thanks for letting me know that.
>>>
>>> But my question was more about writing functions that can operate on any 
>>> types that can be parameterized by other types. For example in Haskell a 
>>> type 'm a' may stand in for 'stream_vt(a)', 'list_vt(a)' and so on and the 
>>> function 'join' of type 'm (m a) -> m a' would equivalent of the 
>>> 'glseq_concat' that I'm trying to implement. From your answer I guess there 
>>> is no way to abstract similarly in ATS?
>>>
>>> Thanks!
>>>
>>>
>>> On Sunday, June 2, 2019 at 4:26:58 PM UTC-5, gmhwxi wrote:

 Say we have glseq_

 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  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-lan...@googlegroups.com.
> To post to this group, send email to ats-lan...@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
>  
> 
> .
>
 -- 
>>> 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-lan...@googlegroups.com.
>>> To post to this group, send email to ats-lan...@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/a93d6fbb-7f2e-4dc9-a1e6-0d90d16d9d9a%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
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 

Re: Implementing glseq_concat

2019-06-02 Thread Hongwei Xi
I think the following try is the closest to what you wanted.
The code type-checks but cannot *always* be properly compiled using ATS2
(due to the higher-order template parameter). This is one problem that I
would like
to address in ATS3 (if I ever get to it).

extern
fun
{x:vtflt}
{f:vtflt -> vtflt}
gseq_concat(f(f(x))): f(x)

local
sexpdef f = stream_vt
in
impltmp
(a:vtflt)
gseq_concat(xx) = list_vt_concat(xx)
end // local

local
sexpdef f = stream_vt
in
impltmp
(a:vtflt)
gseq_concat(xx) = stream_vt_concat(xx)
end // local

On Sun, Jun 2, 2019 at 8:49 PM aditya siram  wrote:

> Oh wow, I just looked it up and I guess 'sexpdef' is new as of ATS3 and
> allows higher-kinded types. Neat!
>
>
> On Sunday, June 2, 2019 at 7:31:57 PM UTC-5, gmhwxi wrote:
>>
>> Sorry, misunderstood. Here is another try:
>>
>>
>> #staload
>> "libats/SATS/list_vt.sats"
>> #staload
>> "libats/SATS/stream_vt.sats"
>>
>> extern
>> fun
>> {xx:vtflt}
>> {xs:vtflt}
>> {x0:vtflt}
>> gseq_concat(xx): xs
>>
>> local
>> sexpdef f = list0_vt
>> in
>> impltmp
>> (a:vtflt)
>> gseq_concat(xx) = list0_vt_concat(xx)
>> end // local
>>
>> local
>> sexpdef f = stream_vt
>> in
>> impltmp
>> (a:vtflt)
>> gseq_concat(xx) = stream_vt_concat(xx)
>> end // local
>>
>> On Sun, Jun 2, 2019 at 8:12 PM aditya siram  wrote:
>>
>>>
>>> Ah thanks for letting me know that.
>>>
>>> But my question was more about writing functions that can operate on any
>>> types that can be parameterized by other types. For example in Haskell a
>>> type 'm a' may stand in for 'stream_vt(a)', 'list_vt(a)' and so on and the
>>> function 'join' of type 'm (m a) -> m a' would equivalent of the
>>> 'glseq_concat' that I'm trying to implement. From your answer I guess there
>>> is no way to abstract similarly in ATS?
>>>
>>> Thanks!
>>>
>>>
>>> On Sunday, June 2, 2019 at 4:26:58 PM UTC-5, gmhwxi wrote:

 Say we have glseq_

 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  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-lan...@googlegroups.com.
> To post to this group, send email to ats-lan...@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
> 
> .
>
 --
>>> 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-lan...@googlegroups.com.
>>> To post to this group, send email to ats-lan...@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/a93d6fbb-7f2e-4dc9-a1e6-0d90d16d9d9a%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 

Re: Implementing glseq_concat

2019-06-02 Thread aditya siram
Oh wow, I just looked it up and I guess 'sexpdef' is new as of ATS3 and 
allows higher-kinded types. Neat!


On Sunday, June 2, 2019 at 7:31:57 PM UTC-5, gmhwxi wrote:
>
> Sorry, misunderstood. Here is another try:
>
>
> #staload
> "libats/SATS/list_vt.sats"
> #staload
> "libats/SATS/stream_vt.sats"
>
> extern
> fun
> {xx:vtflt}
> {xs:vtflt}
> {x0:vtflt}
> gseq_concat(xx): xs
>
> local
> sexpdef f = list0_vt
> in
> impltmp
> (a:vtflt)
> gseq_concat(xx) = list0_vt_concat(xx)
> end // local
>
> local
> sexpdef f = stream_vt
> in
> impltmp
> (a:vtflt)
> gseq_concat(xx) = stream_vt_concat(xx)
> end // local
>
> On Sun, Jun 2, 2019 at 8:12 PM aditya siram  > wrote:
>
>>
>> Ah thanks for letting me know that.
>>
>> But my question was more about writing functions that can operate on any 
>> types that can be parameterized by other types. For example in Haskell a 
>> type 'm a' may stand in for 'stream_vt(a)', 'list_vt(a)' and so on and the 
>> function 'join' of type 'm (m a) -> m a' would equivalent of the 
>> 'glseq_concat' that I'm trying to implement. From your answer I guess there 
>> is no way to abstract similarly in ATS?
>>
>> Thanks!
>>
>>
>> On Sunday, June 2, 2019 at 4:26:58 PM UTC-5, gmhwxi wrote:
>>>
>>> Say we have glseq_
>>>
>>> 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  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-lan...@googlegroups.com.
 To post to this group, send email to ats-lan...@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
  
 
 .

>>> -- 
>> 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-lan...@googlegroups.com .
>> To post to this group, send email to ats-lan...@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/a93d6fbb-7f2e-4dc9-a1e6-0d90d16d9d9a%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/872acfe8-f2a8-4ee2-a887-3ead44890f74%40googlegroups.com.


Re: Implementing glseq_concat

2019-06-02 Thread Hongwei Xi
Sorry, misunderstood. Here is another try:


#staload
"libats/SATS/list_vt.sats"
#staload
"libats/SATS/stream_vt.sats"

extern
fun
{xx:vtflt}
{xs:vtflt}
{x0:vtflt}
gseq_concat(xx): xs

local
sexpdef f = list0_vt
in
impltmp
(a:vtflt)
gseq_concat(xx) = list0_vt_concat(xx)
end // local

local
sexpdef f = stream_vt
in
impltmp
(a:vtflt)
gseq_concat(xx) = stream_vt_concat(xx)
end // local

On Sun, Jun 2, 2019 at 8:12 PM aditya siram  wrote:

>
> Ah thanks for letting me know that.
>
> But my question was more about writing functions that can operate on any
> types that can be parameterized by other types. For example in Haskell a
> type 'm a' may stand in for 'stream_vt(a)', 'list_vt(a)' and so on and the
> function 'join' of type 'm (m a) -> m a' would equivalent of the
> 'glseq_concat' that I'm trying to implement. From your answer I guess there
> is no way to abstract similarly in ATS?
>
> Thanks!
>
>
> On Sunday, June 2, 2019 at 4:26:58 PM UTC-5, gmhwxi wrote:
>>
>> Say we have glseq_
>>
>> 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  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-lan...@googlegroups.com.
>>> To post to this group, send email to ats-lan...@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
>>> 
>>> .
>>>
>> --
> 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/a93d6fbb-7f2e-4dc9-a1e6-0d90d16d9d9a%40googlegroups.com
> 
> .
>

-- 
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/CAPPSPLqNJRdYcNxxRkfL7Cq8n%2BzDmLK3wee83J5n9uBne1DKTw%40mail.gmail.com.


Re: Implementing glseq_concat

2019-06-02 Thread aditya siram

Ah thanks for letting me know that.

But my question was more about writing functions that can operate on any 
types that can be parameterized by other types. For example in Haskell a 
type 'm a' may stand in for 'stream_vt(a)', 'list_vt(a)' and so on and the 
function 'join' of type 'm (m a) -> m a' would equivalent of the 
'glseq_concat' that I'm trying to implement. From your answer I guess there 
is no way to abstract similarly in ATS?

Thanks!


On Sunday, June 2, 2019 at 4:26:58 PM UTC-5, gmhwxi wrote:
>
> Say we have glseq_
>
> 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  > 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-lan...@googlegroups.com .
>> To post to this group, send email to ats-lan...@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
>>  
>> 
>> .
>>
>

-- 
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/a93d6fbb-7f2e-4dc9-a1e6-0d90d16d9d9a%40googlegroups.com.


Re: Implementing glseq_concat

2019-06-02 Thread Hongwei Xi
Say we have glseq_

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  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
> 
> .
>

-- 
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.


Implementing glseq_concat

2019-06-02 Thread aditya siram
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.