diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-05-16 15:45:12 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-05-16 15:45:12 -0400 |
commit | 41f7bb23ff2a9598f8f3bff1487f39f9e91f9f05 (patch) | |
tree | c5073d9b7f368aa38bb4d146c0a6b21900ef1f79 /src/shake.sml | |
parent | 6cb3888614811abc30c6a00a1644e256d1d1c780 (diff) |
Mutual datatypes through Effectize
Diffstat (limited to 'src/shake.sml')
-rw-r--r-- | src/shake.sml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/shake.sml b/src/shake.sml index 35af7436..4a40d336 100644 --- a/src/shake.sml +++ b/src/shake.sml @@ -69,8 +69,9 @@ fun shake file = | (_, acc) => acc) (IS.empty, IS.empty, []) file val (cdef, edef) = foldl (fn ((DCon (_, n, _, c), _), (cdef, edef)) => (IM.insert (cdef, n, [c]), edef) - | ((DDatatype (_, n, _, xncs), _), (cdef, edef)) => - (IM.insert (cdef, n, List.mapPartial #3 xncs), edef) + | ((DDatatype dts, _), (cdef, edef)) => + (foldl (fn ((_, n, _, xncs), cdef) => + IM.insert (cdef, n, List.mapPartial #3 xncs)) cdef dts, edef) | ((DVal (_, n, t, e, _), _), (cdef, edef)) => (cdef, IM.insert (edef, n, ([], t, e))) | ((DValRec vis, _), (cdef, edef)) => let @@ -157,7 +158,7 @@ fun shake file = val s = foldl (fn (c, s) => shakeCon s c) s table_cs in List.filter (fn (DCon (_, n, _, _), _) => IS.member (#con s, n) - | (DDatatype (_, n, _, _), _) => IS.member (#con s, n) + | (DDatatype dts, _) => List.exists (fn (_, n, _, _) => IS.member (#con s, n)) dts | (DVal (_, n, _, _, _), _) => IS.member (#exp s, n) | (DValRec vis, _) => List.exists (fn (_, n, _, _, _) => IS.member (#exp s, n)) vis | (DExport _, _) => true |