[MLton] Bug in LargeInt.scan

Stephen Weeks MLton@mlton.org
Mon, 15 Aug 2005 07:51:37 -0700


> 	 fun toHexR (cread: (char, 'a) reader, uread: (bigInt, 'a) reader) 
> 	    s =
>             case Reader.reader2 cread s of
>                NONE => NONE
>              | SOME ((c1, c2), s') =>
>                   if c1 = #"0" andalso (c2 = #"x" orelse c2 = #"X") then
>                      case uread s' of 
>                         NONE => uread s (* ? *)
>                       | SOME x => SOME x
>                   else uread s
> 
> I was wondering if in the case marked (* ? *) I could simply return
> SOME zero.

And by that I mean SOME (zero, s''), where s'' is the state after
reading c1.