view tests/constraint.ur @ 2269:f7bc7c11a656

Make SQL caches use more of the pure caching machinery, but it's brittle.
author Ziv Scully <ziv@mit.edu>
date Thu, 15 Oct 2015 00:52:04 -0400
parents 71bafe66dbe1
children
line wrap: on
line source
signature S = sig
        con nm :: Name
        con r :: {Type}

        constraint [nm] ~ r
end

structure M : S = struct
        con nm = #A
        con r = [B = float, C = string]

        constraint [A] ~ [B]
        constraint [nm] ~ r
        constraint [C] ~ [D]
end

structure M' = struct
        open M

        con combo = [nm = int] ++ r
end

structure M' = struct
        open constraints M

        con nm' = M.nm
        con r' = M.r
        con combo = [nm' = int] ++ r'
end


signature S' = sig
        con r1 :: {Type}
        con r2 :: {Type}

        constraint r1 ~ r2
end

functor F (M : S) : S' = struct
        con r1 = [M.nm = int]
        con r2 = M.r

        open constraints M
        constraint r1 ~ r2
end