Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /trunk/src/compiler/ast/type-util.sml
ViewVC logotype

Diff of /trunk/src/compiler/ast/type-util.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 380, Tue Oct 5 20:38:05 2010 UTC revision 381, Tue Oct 5 21:42:17 2010 UTC
# Line 6  Line 6 
6    
7  structure TypeUtil : sig  structure TypeUtil : sig
8    
9      (* constructor for building a tensor type of known order, but unknown
10       * dimensions.
11       *)
12        val mkTensorTy : int -> Types.ty
13    
14    (* returns true if the type is a value type (bool, int, string, or tensor) *)    (* returns true if the type is a value type (bool, int, string, or tensor) *)
15      val isValueType : Types.ty -> bool      val isValueType : Types.ty -> bool
16    
# Line 35  Line 40 
40      structure Ty = Types      structure Ty = Types
41      structure MV = MetaVar      structure MV = MetaVar
42    
43      (* constructor for building a tensor type of known order, but unknown
44       * dimensions.
45       *)
46        fun mkTensorTy order =
47              Ty.T_Tensor(
48                Ty.Shape(List.tabulate(order, fn _ => Ty.DimVar(MetaVar.newDimVar()))))
49    
50    (* prune out instantiated meta variables from a type *)    (* prune out instantiated meta variables from a type *)
51      fun prune ty = (case ty      fun prune ty = (case ty
52             of (ty as Ty.T_Var(Ty.TV{bind, ...})) => (case !bind             of (ty as Ty.T_Var(Ty.TV{bind, ...})) => (case !bind

Legend:
Removed from v.380  
changed lines
  Added in v.381

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