[clean-list] Serious bug in the type system

Edsko de Vries devriese at cs.tcd.ie
Wed Jan 2 13:50:57 MET 2008


Hey,

First of all, happy new year to everybody! :-)

On Fri, Dec 21, 2007 at 04:20:42PM +0100, John van Groningen wrote:
> >  ohoh :: *{#Char} -> *(*{#Char}, {#Char})
> >  ohoh arr
> >      #! arr` = arr
> >      = (update arr 0 'a', arr`)
> >...
> 
> This is caused by a bug in the compiler. If the result of #! is an
> array with strict or unboxed values, the compiler should not treat
> this as an observation, but type the expression in the usual way.
> 
> I have fixed this bug in the compiler. It no longer types #! expressions
> with arrays in the result in a special way.
> 
> For unique arrays with unboxed values this may not be necessary, it may be
> correct to type these as observers.

I don't understand your last remark; with unboxed values, 'ohoh' is
already rejected by the compiler:

  ohoh :: *{Char} -> *(*{Char}, {Char})
  ohoh arr
      #! arr` = arr
      = (update arr 0 'a', arr`)

gives

  Uniqueness error [t.icl,5,ohoh]: "arr" demanded attribute cannot be
  offered by shared object

This makes sense, since unboxed values can have thunks inside them, thus
violating the hyperstrict condition -- no? 

Edsko


More information about the clean-list mailing list