Exemple #1
0
        private static Signature InferSignature(Func <string, Classification <dynamic> > doImport, Environment <Classification <TypedTerm> > environment, ModuleType moduleType)
        {
            var untyped = moduleType.Members;

            var members = new Classification <string> [untyped.Length];

            foreach (var index in ArrayOperations.CountUp(untyped.Length))
            {
                var binding = untyped[index];

                var typed = InferType(doImport, environment, binding.Value).Normalized(environment);

                var quantifier = typed.ShiftDown(binding.Key);

                members[index] = quantifier;

                environment = environment.Push(quantifier);
            }

            return(new Signature(members));
        }
Exemple #2
0
 public Module(ModuleType content)
     : base(Productions.Module)
 {
     Content = content;
 }