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

SCM Repository

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

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

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

revision 2297, Fri Mar 15 22:05:31 2013 UTC revision 2298, Fri Mar 15 22:18:22 2013 UTC
# Line 30  Line 30 
30    (* return true if the type is an image type *)    (* return true if the type is an image type *)
31      val isImageType : Types.ty -> bool      val isImageType : Types.ty -> bool
32    
33      (* return the range (return type) of a function type *)
34        val rngOf : Types.ty -> Types.ty
35    
36    (* prune out instantiated meta variables from a type.  We also normalize    (* prune out instantiated meta variables from a type.  We also normalize
37     * tensor shapes (i.e., remove 1s).     * tensor shapes (i.e., remove 1s).
38     *)     *)
# Line 270  Line 273 
273                  end                  end
274            (* end case *))            (* end case *))
275    
276      (* return the range (return type) of a function type *)
277        fun rngOf (Ty.T_Fun(_, ty)) = ty
278          | rngOf ty = raise Fail(concat["TypeUtil.rngOf(", toString ty, ")"])
279    
280      fun slice (Ty.T_Tensor(Ty.Shape l), mask) = let      fun slice (Ty.T_Tensor(Ty.Shape l), mask) = let
281            fun f (d, true, dd) = dd            fun f (d, true, dd) = dd
282              | f (d, false, dd) = d::dd              | f (d, false, dd) = d::dd

Legend:
Removed from v.2297  
changed lines
  Added in v.2298

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