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

SCM Repository

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

Diff of /branches/pure-cfg/src/compiler/ast/type-util.sml

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

revision 227, Wed Aug 4 05:27:13 2010 UTC revision 228, Wed Aug 4 13:36:35 2010 UTC
# Line 6  Line 6 
6    
7  structure TypeUtil : sig  structure TypeUtil : sig
8    
9      (* returns true if the type is a value type (bool, int, string, or tensor) *)
10        val isValueType : Types.ty -> bool
11    
12    (* prune out instantiated meta variables *)    (* prune out instantiated meta variables *)
13      val prune : Types.ty -> Types.ty      val prune : Types.ty -> Types.ty
14      val pruneDiff : Types.diff -> Types.diff      val pruneDiff : Types.diff -> Types.diff
# Line 141  Line 144 
144              | Ty.DimVar v => MV.dimVarToString v              | Ty.DimVar v => MV.dimVarToString v
145            (* end case *))            (* end case *))
146    
147      (* returns true if the type is a value type (bool, int, string, or tensor) *)
148        fun isValueType ty = (case prune ty
149               of Ty.T_Bool => true
150                | Ty.T_Int => true
151                | Ty.T_String => true
152                | Ty.T_Tensor _ => true
153                | _ => false
154              (* end case *))
155    
156      fun toString ty = (case pruneHead ty      fun toString ty = (case pruneHead ty
157             of Ty.T_Var tv => MV.tyVarToString tv             of Ty.T_Var tv => MV.tyVarToString tv
158              | Ty.T_Bool => "bool"              | Ty.T_Bool => "bool"

Legend:
Removed from v.227  
changed lines
  Added in v.228

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