Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /smlnj-lib/releases/release-110.69/HashCons/hash-cons-ground-fn.sml
ViewVC logotype

View of /smlnj-lib/releases/release-110.69/HashCons/hash-cons-ground-fn.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3249 - (download) (annotate)
Wed Dec 31 02:30:31 2008 UTC (10 years, 6 months ago) by jriehl
File size: 533 byte(s)
Release 110.69
(* hash-cons-ground-fn.sml
 *
 * COPYRIGHT (c) 2001 Bell Labs, Lucent Technologies
 *
 * Functor for defining hashed-cons representation of ground terms.
 *)

functor HashConsGroundFn (T : HASH_KEY) : sig

    type hash_key = T.hash_key
    type obj = hash_key HashCons.obj

    val mk : hash_key -> obj

  end = struct

    structure HC = HashCons

    type hash_key = T.hash_key
    type obj = hash_key HC.obj

    val tbl = HC.new {eq = T.sameKey}

    val cons = HC.cons0 tbl

    fun mk term = cons(T.hashVal term, term)

  end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0