[Ur] Unexpected type error: "Substitution in constructor is blocked by a too-deep unification variable"

Karn Kallio tierpluspluslists at gmail.com
Thu Jan 6 08:04:34 EST 2011


> Why rev1 is ok and rev2-4 throws "Substitution in constructor is blocked by
> a too-deep unification variable" while types seems to be ok?

Include the return type, like this:

fun rev2 [e ::: Type] (xs : list e) (ys : list e) : list e =
     case xs of
        [] => ys
       | x :: xs => rev2 xs (x :: ys)

val intList = 1 :: 2 :: 3 :: []

fun main () = return <xml>
  <head>
    <title>Example</title>
  </head>
  <body>
    <h2>Example</h2>
    <p>
      {[rev2 intList []]}
    </p>
  </body>
</xml>



More information about the Ur mailing list