View equality in template function

Hello all,

Here’s an issue:

Is there a solution not involving unsafe casts? This sort of
loop-construction seems like a very common thing to do. Threading views is
also common, but templates do not allow that. If env is given a viewtype
(@[int][N] @ A | void), it still doesn’t work (no template is found for
fwork).

Unfortunately, this cannot be done.

The only way I can see to make it safe is this:

absvtype myenv = void
// implement the following two proof functions
prfun myenv_decode (&myenv >> void): @[int][N]@A
prfun myenv_encode (&void >> myenv, @[int][N]@A): void

implement
loop$fwork (env) = … // using decode and encode

…loop()…On Thursday, March 26, 2015 at 2:03:21 AM UTC-4, Artyom Shalkhakov wrote:

Hello all,

Here’s an issue:

View equalities in templates · GitHub

Is there a solution not involving unsafe casts? This sort of
loop-construction seems like a very common thing to do. Threading views is
also common, but templates do not allow that. If env is given a viewtype
(@[int][N] @ A | void), it still doesn’t work (no template is found for
fwork).

Unfortunately, this cannot be done.

The only way I can see to make it safe is this:

absvtype myenv = void
// implement the following two proof functions
prfun myenv_decode (&myenv >> void): @[int][N]@A
prfun myenv_encode (&void >> myenv, @[int][N]@A): void

implement
loop$fwork (env) = … // using decode and encode

…loop()…

Okay, if you say so. I’ll be using some unsafe casts then.> On Thursday, March 26, 2015 at 2:03:21 AM UTC-4, Artyom Shalkhakov wrote:

Hello all,

Here’s an issue:

View equalities in templates · GitHub

Is there a solution not involving unsafe casts? This sort of
loop-construction seems like a very common thing to do. Threading views is
also common, but templates do not allow that. If env is given a viewtype
(@[int][N] @ A | void), it still doesn’t work (no template is found for
fwork).