I will give my thoughts too, because why not.

On 9 January 2015 at 18:54, Keean Schupke <[email protected]> wrote:
> Just some random thoughts on this... firstly a lot of those things can be
> inferred. As long as primitives express their effects, the effects of a
> function can be inferred. PureScript seems to have a good effect system. All
> it requires is the addition of row-types to the type system, and then the
> whole effect system just becomes a row-polymorphic monad.

Neat, I should definitely check that out.

> I was thinking about linear types rather than region types, and would be
> interested in your thoughts on this.

I think it would be a nice to have, though for reasons unrelated to
memory.  Better would be substructural typing with separate affinity
and relevance.  But region types are significantly more flexible in
terms of the patterns they can describe.

> I haven't given much thought to mutability annotations, but is seems this
> should be reflected in the type.

Different kinds of mutability share an important subtyping
relationship which, for the sake of genericity, seems simpler not to
make it part of the type.  Do you really want distinct types for lists
that you can only read, for mutable lists, for immutable lists, for
immutable lists of mutable values, and for mutable lists of read-only
values?

They do need to be part of the type system because their misuse leads
to unsoundness, but requiring that different classifications of
mutability be distinct types seems to lead to awkwardness when you're
just trying to implement something with reasonable variance over
mutability.

-- 
William Leslie

Notice:
Likely much of this email is, by the nature of copyright, covered
under copyright law.  You absolutely MAY reproduce any part of it in
accordance with the copyright law of the nation you are reading this
in.  Any attempt to DENY YOU THOSE RIGHTS would be illegal without
prior contractual agreement.
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to