comparison src/specialize.sml @ 315:e21d0dddda09

Unpoly non-recursive function
author Adam Chlipala <adamc@hcoop.net>
date Thu, 11 Sep 2008 09:36:47 -0400
parents df5fd8f6913a
children d20d6afc1206
comparison
equal deleted inserted replaced
314:a07f476d9b61 315:e21d0dddda09
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE. 25 * POSSIBILITY OF SUCH DAMAGE.
26 *) 26 *)
27 27
28 (* Simplify a Core program algebraically *) 28 (* Simplify a Core program by repeating polymorphic definitions of datatypes *)
29 29
30 structure Specialize :> SPECIALIZE = struct 30 structure Specialize :> SPECIALIZE = struct
31 31
32 open Core 32 open Core
33 33
59 59
60 type state = { 60 type state = {
61 count : int, 61 count : int,
62 datatypes : datatyp IM.map, 62 datatypes : datatyp IM.map,
63 constructors : int IM.map, 63 constructors : int IM.map,
64 decls : decl list 64 decls : decl list
65 } 65 }
66 66
67 fun kind (k, st) = (k, st) 67 fun kind (k, st) = (k, st)
68 68
69 val isOpen = U.Con.exists {kind = fn _ => false, 69 val isOpen = U.Con.exists {kind = fn _ => false,