Skip to content

Commit 22feef9

Browse files
committed
Reword conditions for reify and reflect.
1 parent edd28b1 commit 22feef9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

jvm/src/Language/Java.hs

+4-3
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ class (SingI (Interp a), IsReferenceType (Interp a)) => Interpretation (a :: k)
469469
-- say, unmarshall a Java object to a Haskell value. Unlike coercing, in general
470470
-- reifying induces allocations and copies.
471471
class Interpretation a => Reify a where
472-
-- | Precondition: The input reference is valid only until reify returns.
472+
-- | Invariant: the argument and the result are distinct. That is, the result
473+
-- and the argument share no direct JVM object references.
473474
reify :: J (Interp a) -> IO a
474475

475476
default reify :: (Coercible a, Interp a ~ Ty a) => J (Interp a) -> IO a
@@ -479,8 +480,8 @@ class Interpretation a => Reify a where
479480
-- say, marshall a Haskell value to a Java object. Unlike coercing, in general
480481
-- reflection induces allocations and copies.
481482
class Interpretation a => Reflect a where
482-
-- | Postcondition: The input value remains valid if the output reference is
483-
-- deleted.
483+
-- | Invariant: the argument and the result are distinct. That is, the result
484+
-- and the argument share no direct JVM object references.
484485
reflect :: a -> IO (J (Interp a))
485486

486487
default reflect :: (Coercible a, Interp a ~ Ty a) => a -> IO (J (Interp a))

0 commit comments

Comments
 (0)