{to/from}Poly Bug?

View: New views
2 Messages — Rating Filter:   Alert me  

{to/from}Poly Bug?

by Wesley W. Terpstra :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Maybe I've misunderstood the intention of these methods?

terpstra@orange:~$ cat bug.sml
val x = Word8Array.array (10, 0w0)
val y : Word8.word array = MLton.Word8Array.toPoly x

terpstra@orange:~$ mlton bug.sml
Error: bug.sml 2.5.
  Pattern and expression disagree.
    pattern:    [Word8.word] array
    expression: [MLton.Word8Array.elem] array
    in: (y): Word8.word array = MLton.Word8Array.toPoly x
compilation aborted: parseAndElaborate reported errors

_______________________________________________
MLton mailing list
MLton@...
http://mlton.org/mailman/listinfo/mlton

Re: {to/from}Poly Bug?

by Matthew Fluet-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

No misunderstanding.  There seems to be some missing sharing
constraints in the signature that defines the basis library.  The
following is untested, but it or something like it should do the
trick:

Index: basis-library/libs/basis-extra/top-level/basis.sig
===================================================================
--- basis-library/libs/basis-extra/top-level/basis.sig  (revision 7269)
+++ basis-library/libs/basis-extra/top-level/basis.sig  (working copy)
@@ -717,9 +717,15 @@
      sharing type Word64Array2.vector = Word64Vector.vector
      sharing type MLton.BinIO.instream = BinIO.instream
      sharing type MLton.BinIO.outstream = BinIO.outstream
+      sharing type MLton.CharArray.elem = CharArray.elem
+      sharing type MLton.CharArray.t = CharArray.array
+      sharing type MLton.CharVector.elem = CharVector.elem
+      sharing type MLton.CharVector.t = CharVector.vector
      sharing type MLton.TextIO.instream = TextIO.instream
      sharing type MLton.TextIO.outstream = TextIO.outstream
+      sharing type MLton.Word8Array.elem = Word8Array.elem
      sharing type MLton.Word8Array.t = Word8Array.array
+      sharing type MLton.Word8Vector.elem = Word8Vector.elem
      sharing type MLton.Word8Vector.t = Word8Vector.vector
   end

On Sat, Oct 31, 2009 at 1:54 PM, Wesley W. Terpstra <wesley@...> wrote:

> Maybe I've misunderstood the intention of these methods?
>
> terpstra@orange:~$ cat bug.sml
> val x = Word8Array.array (10, 0w0)
> val y : Word8.word array = MLton.Word8Array.toPoly x
>
> terpstra@orange:~$ mlton bug.sml
> Error: bug.sml 2.5.
>  Pattern and expression disagree.
>    pattern:    [Word8.word] array
>    expression: [MLton.Word8Array.elem] array
>    in: (y): Word8.word array = MLton.Word8Array.toPoly x
> compilation aborted: parseAndElaborate reported errors
>
> _______________________________________________
> MLton mailing list
> MLton@...
> http://mlton.org/mailman/listinfo/mlton
>

_______________________________________________
MLton mailing list
MLton@...
http://mlton.org/mailman/listinfo/mlton