# Val+@list\_vt\_cons (\_, xs2) = xs1

**URL:** <https://discourse.ats-lang.org/t/val-list-vt-cons---xs2-xs1/678>\
**Category:** Google Group\
**Created:** [January 16, 2014, 4:39am UTC](https://discourse.ats-lang.org/t/val-list-vt-cons---xs2-xs1/678 "2014-01-16T04:39:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [January 16, 2014, 4:39am UTC](https://discourse.ats-lang.org/t/val-list-vt-cons---xs2-xs1/678/1 "2014-01-16T04:39:19Z")

</div>

val+ means the pattern must be exhaustive (i.e. it is asserted that xs1 is  
a non-nil list). xs2 is now a (potentially nil) part.

What does @ mean?

---

<div class="post-metadata">

**Author:** ![Brandon\_Barker](https://sea1.discourse-cdn.com/flex019/user_avatar/discourse.ats-lang.org/brandon_barker/32/61_2.png) [@Brandon\_Barker](https://discourse.ats-lang.org/u/Brandon_Barker)\
**Post date:** [January 16, 2014, 5:01am UTC](https://discourse.ats-lang.org/t/val-list-vt-cons---xs2-xs1/678/2 "2014-01-16T05:01:06Z")

</div>

In ATS2, my impression is that a datavtype only needs to be unfolded for  
modification in the strict sense:  
freeing or deleting a datavtype does not require unfolding (which iirc it  
did in ATS1).On Wednesday, January 15, 2014 11:50:41 PM UTC-5, gmhwxi wrote:

> Actually, unfolding is a better word for describing “open-up”.
> 
> If a node (of a datatype) is unfolded for modification, then usually it  
> needs to be folded explicitly  
> using ‘fold@’.
> 
> On Wednesday, January 15, 2014 11:45:49 PM UTC-5, gmhwxi wrote:
> 
> > It is means that the matched list-node is “opened-up” so that fields in  
> > this node can be modified.
> > 
> > On Wednesday, January 15, 2014 11:39:19 PM UTC-5, Brandon Barker wrote:
> > 
> > > val+ means the pattern must be exhaustive (i.e. it is asserted that xs1  
> > > is a non-nil list). xs2 is now a (potentially nil) part.
> > > 
> > > What does @ mean?

---

<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:** [January 16, 2014, 5:10am UTC](https://discourse.ats-lang.org/t/val-list-vt-cons---xs2-xs1/678/3 "2014-01-16T05:10:36Z")

</div>

Freeing a node (of some datavtype) does not require unfolding in ATS1  
either.

The improvement of ATS2 over ATS1 is in the case where no modification  
is involved. In such a case, a node of a datavtype is treated just like a  
node  
of a datatype in ATS2.On Thursday, January 16, 2014 12:01:06 AM UTC-5, Brandon Barker wrote:

> In ATS2, my impression is that a datavtype only needs to be unfolded for  
> modification in the strict sense:  
> freeing or deleting a datavtype does not require unfolding (which iirc  
> it did in ATS1).
> 
> On Wednesday, January 15, 2014 11:50:41 PM UTC-5, gmhwxi wrote:
> 
> > Actually, unfolding is a better word for describing “open-up”.
> > 
> > If a node (of a datatype) is unfolded for modification, then usually it  
> > needs to be folded explicitly  
> > using ‘fold@’.
> > 
> > On Wednesday, January 15, 2014 11:45:49 PM UTC-5, gmhwxi wrote:
> > 
> > > It is means that the matched list-node is “opened-up” so that fields in  
> > > this node can be modified.
> > > 
> > > On Wednesday, January 15, 2014 11:39:19 PM UTC-5, Brandon Barker wrote:
> > > 
> > > > val+ means the pattern must be exhaustive (i.e. it is asserted that  
> > > > xs1 is a non-nil list). xs2 is now a (potentially nil) part.
> > > > 
> > > > What does @ mean?

---

<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:** [January 16, 2014, 4:45am UTC](https://discourse.ats-lang.org/t/val-list-vt-cons---xs2-xs1/678/4 "2014-01-16T04:45:49Z")

</div>

It is means that the matched list-node is “opened-up” so that fields in  
this node can be modified.On Wednesday, January 15, 2014 11:39:19 PM UTC-5, Brandon Barker wrote:

> val+ means the pattern must be exhaustive (i.e. it is asserted that xs1  
> is a non-nil list). xs2 is now a (potentially nil) part.
> 
> What does @ mean?

---

<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:** [January 16, 2014, 4:50am UTC](https://discourse.ats-lang.org/t/val-list-vt-cons---xs2-xs1/678/5 "2014-01-16T04:50:41Z")

</div>

Actually, unfolding is a better word for describing “open-up”.

If a node (of a datatype) is unfolded for modification, then usually it  
needs to be folded explicitly  
using ‘fold@’.On Wednesday, January 15, 2014 11:45:49 PM UTC-5, gmhwxi wrote:

> It is means that the matched list-node is “opened-up” so that fields in  
> this node can be modified.
> 
> On Wednesday, January 15, 2014 11:39:19 PM UTC-5, Brandon Barker wrote:
> 
> > val+ means the pattern must be exhaustive (i.e. it is asserted that xs1  
> > is a non-nil list). xs2 is now a (potentially nil) part.
> > 
> > What does @ mean?
