Template and Effect

Hi,

I’m trying to implement gcompare_val_val for a datatype list, but
encounters an error saying “some disallowed effects may be incurred: 1”

datatype list (a:t@ype) = ...

fun {a:t@ype} list_compare ...

implement (a) gcompare_val_val<list a> (x, y) = list_compare (x, y)

What is that effect? And how should I implement that template for list a?

Thanks,

This definitely works. but I don’t think list_compare has any effect.
Explicitly marking list_comare as (a, a):<> int seems to do the job as wellOn Thursday, August 11, 2016 at 5:21:01 PM UTC-4, gmhwxi wrote:

Try:

implement (a) gcompare_val_val (x, y) = $effmask_all( list_compare
(x, y) )

On Thu, Aug 11, 2016 at 2:03 PM, Steinway Wu <> wrote:

Hi,

I’m trying to implement gcompare_val_val for a datatype list, but
encounters an error saying “some disallowed effects may be incurred: 1”

datatype list (a:t@ype) = ...

fun {a:t@ype} list_compare ...

implement (a) gcompare_val_val<list a> (x, y) = list_compare (x, y)

What is that effect? And how should I implement that template for list a?

Thanks,

Try:

implement (a) gcompare_val_val (x, y) = $effmask_all( list_compare
(x, y) )On Thu, Aug 11, 2016 at 2:03 PM, Steinway Wu stein...@gmail.com wrote:

Hi,

I’m trying to implement gcompare_val_val for a datatype list, but
encounters an error saying “some disallowed effects may be incurred: 1”

datatype list (a:t@ype) = ...

fun {a:t@ype} list_compare ...

implement (a) gcompare_val_val<list a> (x, y) = list_compare (x, y)

What is that effect? And how should I implement that template for list a?

Thanks,


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.
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/c4495032-e055-4cda-8d5f-45fa34d23838%
40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/c4495032-e055-4cda-8d5f-45fa34d23838%40googlegroups.com?utm_medium=email&utm_source=footer
.