# Creating new effects?

**URL:** <https://discourse.ats-lang.org/t/creating-new-effects/378>\
**Category:** Google Group\
**Created:** [August 30, 2014, 11:03pm UTC](https://discourse.ats-lang.org/t/creating-new-effects/378 "2014-08-30T23:03:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shea\_Levy](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Shea\_Levy](https://discourse.ats-lang.org/u/Shea_Levy)\
**Post date:** [August 30, 2014, 11:03pm UTC](https://discourse.ats-lang.org/t/creating-new-effects/378/1 "2014-08-30T23:03:17Z")

</div>

Hi all,

Is it possible to create new effects of sort eff? For example, none of  
the existing cases at [1](https://github.com/githwxi/ATS-Postiats/wiki/effects) seem to cover the side effects of the 'open’  
system call, but that is surely not pure!

~Shea

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [August 31, 2014, 6:27pm UTC](https://discourse.ats-lang.org/t/creating-new-effects/378/2 "2014-08-31T18:27:28Z")

</div>

It is hard to say.

I occasionally use effect-tracking to catch bugs causing non-termination.

When implementing (pure) algorithms, one may have the luxury to be very  
thorough. In general, I think effect-tracking only works on code of very  
small  
scale.On Sun, Aug 31, 2014 at 2:18 PM, Shea Levy [sh...@shealevy.com](mailto:sh...@shealevy.com) wrote:

> Ah I see, thanks. Under what circumstances should I care about  
> explicitly annotating functions with their effects?
> 
> ~Shea
> 
> On Sat, Aug 30, 2014 at 06:11:45PM -0700, gmhwxi wrote:
> 
> > The sort ‘eff’ is currently not extensible.
> > 
> > The effect system in ATS is not meant to track effects like ‘open’.  
> > Tracking such effects makes programming intractable in general. The  
> > primary use of the effect system in ATS is to ensure that an implemented  
> > proof function is indeed pure.
> > 
> > On Saturday, August 30, 2014 7:03:37 PM UTC-4, Shea Levy wrote:
> > 
> > > Hi all,
> > > 
> > > Is it possible to create new effects of sort eff? For example, none of  
> > > the existing cases at [1](https://github.com/githwxi/ATS-Postiats/wiki/effects) seem to cover the side effects of the ‘open’  
> > > system call, but that is surely not pure!
> > > 
> > > ~Shea
> > 
> > –  
> > 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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/ats-lang-users/f7eddf8a-ba78-4777-a0f1-4f63aa885472%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/f7eddf8a-ba78-4777-a0f1-4f63aa885472%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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/20140831181825.GD2237%40nixos.hsd1.nh.comcast.net](https://groups.google.com/d/msgid/ats-lang-users/20140831181825.GD2237%40nixos.hsd1.nh.comcast.net)  
> .

---

<div class="post-metadata">

**Author:** ![Shea\_Levy](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Shea\_Levy](https://discourse.ats-lang.org/u/Shea_Levy)\
**Post date:** [August 31, 2014, 6:18pm UTC](https://discourse.ats-lang.org/t/creating-new-effects/378/3 "2014-08-31T18:18:25Z")

</div>

Ah I see, thanks. Under what circumstances should I care about  
explicitly annotating functions with their effects?

~SheaOn Sat, Aug 30, 2014 at 06:11:45PM -0700, gmhwxi wrote:

> The sort ‘eff’ is currently not extensible.
> 
> The effect system in ATS is not meant to track effects like ‘open’.  
> Tracking such effects makes programming intractable in general. The  
> primary use of the effect system in ATS is to ensure that an implemented  
> proof function is indeed pure.
> 
> On Saturday, August 30, 2014 7:03:37 PM UTC-4, Shea Levy wrote:
> 
> > Hi all,
> > 
> > Is it possible to create new effects of sort eff? For example, none of  
> > the existing cases at [1](https://github.com/githwxi/ATS-Postiats/wiki/effects) seem to cover the side effects of the ‘open’  
> > system call, but that is surely not pure!
> > 
> > ~Shea
> 
> –  
> 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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/ats-lang-users/f7eddf8a-ba78-4777-a0f1-4f63aa885472%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/f7eddf8a-ba78-4777-a0f1-4f63aa885472%40googlegroups.com).

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [August 31, 2014, 1:11am UTC](https://discourse.ats-lang.org/t/creating-new-effects/378/4 "2014-08-31T01:11:45Z")

</div>

The sort ‘eff’ is currently not extensible.

The effect system in ATS is not meant to track effects like ‘open’.  
Tracking such effects makes programming intractable in general. The  
primary use of the effect system in ATS is to ensure that an implemented  
proof function is indeed pure.On Saturday, August 30, 2014 7:03:37 PM UTC-4, Shea Levy wrote:

> Hi all,
> 
> Is it possible to create new effects of sort eff? For example, none of  
> the existing cases at [1](https://github.com/githwxi/ATS-Postiats/wiki/effects) seem to cover the side effects of the ‘open’  
> system call, but that is surely not pure!
> 
> ~Shea

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [August 31, 2014, 6:41pm UTC](https://discourse.ats-lang.org/t/creating-new-effects/378/5 "2014-08-31T18:41:12Z")

</div>

I would say that is the right way to proceed.

ATS is feature-rich. It is very important to make sure that  
you do not get distracted by features at this stage.On Sunday, August 31, 2014 2:33:25 PM UTC-4, Shea Levy wrote:

> I see, thanks. I think for now I will just work without effect  
> annotations until I find a use case.
> 
> ~Shea
> 
> On Sun, Aug 31, 2014 at 02:27:28PM -0400, Hongwei Xi wrote:
> 
> > It is hard to say.
> > 
> > I occasionally use effect-tracking to catch bugs causing  
> > non-termination.
> > 
> > When implementing (pure) algorithms, one may have the luxury to be very  
> > thorough. In general, I think effect-tracking only works on code of very  
> > small  
> > scale.
> > 
> > On Sun, Aug 31, 2014 at 2:18 PM, Shea Levy \<[sh...@shealevy.com](mailto:sh...@shealevy.com) \<javascript:\>\> wrote:
> > 
> > > Ah I see, thanks. Under what circumstances should I care about  
> > > explicitly annotating functions with their effects?
> > > 
> > > ~Shea
> > > 
> > > On Sat, Aug 30, 2014 at 06:11:45PM -0700, gmhwxi wrote:
> > > 
> > > > The sort ‘eff’ is currently not extensible.
> > > > 
> > > > The effect system in ATS is not meant to track effects like ‘open’.  
> > > > Tracking such effects makes programming intractable in general. The  
> > > > primary use of the effect system in ATS is to ensure that an  
> > > > implemented  
> > > > proof function is indeed pure.
> > > > 
> > > > On Saturday, August 30, 2014 7:03:37 PM UTC-4, Shea Levy wrote:
> > > > 
> > > > > Hi all,
> > > > > 
> > > > > Is it possible to create new effects of sort eff? For example,  
> > > > > none of  
> > > > > the existing cases at [1](https://github.com/githwxi/ATS-Postiats/wiki/effects) seem to cover the side effects of the  
> > > > > ‘open’  
> > > > > system call, but that is surely not pure!
> > > > > 
> > > > > ~Shea
> > > > 
> > > > –  
> > > > 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...@googlegroups.com](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > > > \<javascript:\>.  
> > > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > > To view this discussion on the web visit
> 
> [https://groups.google.com/d/msgid/ats-lang-users/f7eddf8a-ba78-4777-a0f1-4f63aa885472%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/f7eddf8a-ba78-4777-a0f1-4f63aa885472%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...@googlegroups.com](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > > \<javascript:\>.  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > To view this discussion on the web visit
> 
> [https://groups.google.com/d/msgid/ats-lang-users/20140831181825.GD2237%40nixos.hsd1.nh.comcast.net](https://groups.google.com/d/msgid/ats-lang-users/20140831181825.GD2237%40nixos.hsd1.nh.comcast.net)
> 
> > > .
> > 
> > –  
> > 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...@googlegroups.com](mailto:ats-lang...@googlegroups.com) \<javascript:\>.  
> > To post to this group, send email to [ats-l...@googlegroups.com](mailto:ats-l...@googlegroups.com)  
> > \<javascript:\>.  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrNzsokUcUHAy90tTWznjFaUNp%2BWFv8uevGQNcqZP2xCA%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrNzsokUcUHAy90tTWznjFaUNp%2BWFv8uevGQNcqZP2xCA%40mail.gmail.com).

---

<div class="post-metadata">

**Author:** ![Yannick\_Duchene](https://avatars.discourse-cdn.com/v4/letter/y/b77776/32.png) [@Yannick\_Duchene](https://discourse.ats-lang.org/u/Yannick_Duchene)\
**Post date:** [September 28, 2014, 2:15am UTC](https://discourse.ats-lang.org/t/creating-new-effects/378/6 "2014-09-28T02:15:55Z")

</div>

> The sort ‘eff’ is currently not extensible.
> 
> The effect system in ATS is not meant to track effects like ‘open’.

Better use a linear type instead?

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [September 28, 2014, 2:58pm UTC](https://discourse.ats-lang.org/t/creating-new-effects/378/7 "2014-09-28T14:58:15Z")

</div>

Yes, using linear proofs (of views) is another possibility. Another  
possibility  
is to adopt a monadic style of programming.On Sat, Sep 27, 2014 at 10:15 PM, ‘Yannick Duchêne’ via ats-lang-users \< [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com)\> wrote:

> Le dimanche 31 août 2014 03:11:45 UTC+2, gmhwxi a écrit :
> 
> > The sort ‘eff’ is currently not extensible.
> > 
> > The effect system in ATS is not meant to track effects like ‘open’.
> 
> Better use a linear type instead?
> 
> –  
> 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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/f3f8e29c-4ae8-4b18-a3dd-7a8ba56d8b88%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/f3f8e29c-4ae8-4b18-a3dd-7a8ba56d8b88%40googlegroups.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/f3f8e29c-4ae8-4b18-a3dd-7a8ba56d8b88%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/f3f8e29c-4ae8-4b18-a3dd-7a8ba56d8b88%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

**Author:** ![Shea\_Levy](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@Shea\_Levy](https://discourse.ats-lang.org/u/Shea_Levy)\
**Post date:** [August 31, 2014, 6:33pm UTC](https://discourse.ats-lang.org/t/creating-new-effects/378/8 "2014-08-31T18:33:19Z")

</div>

I see, thanks. I think for now I will just work without effect  
annotations until I find a use case.

~SheaOn Sun, Aug 31, 2014 at 02:27:28PM -0400, Hongwei Xi wrote:

> It is hard to say.
> 
> I occasionally use effect-tracking to catch bugs causing non-termination.
> 
> When implementing (pure) algorithms, one may have the luxury to be very  
> thorough. In general, I think effect-tracking only works on code of very  
> small  
> scale.
> 
> On Sun, Aug 31, 2014 at 2:18 PM, Shea Levy [sh...@shealevy.com](mailto:sh...@shealevy.com) wrote:
> 
> > Ah I see, thanks. Under what circumstances should I care about  
> > explicitly annotating functions with their effects?
> > 
> > ~Shea
> > 
> > On Sat, Aug 30, 2014 at 06:11:45PM -0700, gmhwxi wrote:
> > 
> > > The sort ‘eff’ is currently not extensible.
> > > 
> > > The effect system in ATS is not meant to track effects like ‘open’.  
> > > Tracking such effects makes programming intractable in general. The  
> > > primary use of the effect system in ATS is to ensure that an implemented  
> > > proof function is indeed pure.
> > > 
> > > On Saturday, August 30, 2014 7:03:37 PM UTC-4, Shea Levy wrote:
> > > 
> > > > Hi all,
> > > > 
> > > > Is it possible to create new effects of sort eff? For example, none of  
> > > > the existing cases at [1](https://github.com/githwxi/ATS-Postiats/wiki/effects) seem to cover the side effects of the ‘open’  
> > > > system call, but that is surely not pure!
> > > > 
> > > > ~Shea
> > > 
> > > –  
> > > 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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/ats-lang-users/f7eddf8a-ba78-4777-a0f1-4f63aa885472%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/f7eddf8a-ba78-4777-a0f1-4f63aa885472%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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/ats-lang-users/20140831181825.GD2237%40nixos.hsd1.nh.comcast.net](https://groups.google.com/d/msgid/ats-lang-users/20140831181825.GD2237%40nixos.hsd1.nh.comcast.net)  
> > .
> 
> –  
> 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-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrNzsokUcUHAy90tTWznjFaUNp%2BWFv8uevGQNcqZP2xCA%40mail.gmail.com](https://groups.google.com/d/msgid/ats-lang-users/CAPPSPLrNzsokUcUHAy90tTWznjFaUNp%2BWFv8uevGQNcqZP2xCA%40mail.gmail.com).
