(* data-func.sml *) (* Copyright (C) 2006 Alley Stoughton This file is part of crypto, a cryptogram encoder/decoder. See the file COPYING.txt for copying and usage restrictions *) (* a functor that takes in a structure LinOrd of signature LIN_ORD, and a list of symbols from LinOrd.elem, and returns a structure DATA where type SymLinOrd.elem = LinOrd.elem whose SymLinOrd structure is LinOrd and whose symbols value is the result of converting symbols into a set *) functor DataFunc(structure LinOrd : LIN_ORD val symbols : LinOrd.elem list) :> DATA where type SymLinOrd.elem = LinOrd.elem = struct structure SymLinOrd = LinOrd structure SymLexicon = LexiconFunc(structure LinOrd = LinOrd) structure SymSet = SetFunc(structure LinOrd = LinOrd) type sym = SymLinOrd.elem type sym_lexicon = SymLexicon.lexicon type sym_set = SymSet.set val symbols = SymSet.fromList symbols type word = sym list type line = word list type msg = line list datatype pds = Old of sym | New of sym type pdw = pds list type pdl = pdw list type pdm = pdl list end;