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

SCM Repository

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

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

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

revision 2151, Sun Feb 17 19:07:20 2013 UTC revision 2152, Sun Feb 17 19:39:37 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 264  Line 267 
267                  end                  end
268            (* end case *))            (* end case *))
269    
270      (* return the range (return type) of a function type *)
271        fun rngOf (Ty.T_Fun(_, ty)) = ty
272          | rngOf ty = raise Fail(concat["TypeUtil.rngOf(", toString ty, ")"])
273    
274      fun slice (Ty.T_Tensor(Ty.Shape l), mask) = let      fun slice (Ty.T_Tensor(Ty.Shape l), mask) = let
275            fun f (d, true, dd) = dd            fun f (d, true, dd) = dd
276              | f (d, false, dd) = d::dd              | f (d, false, dd) = d::dd

Legend:
Removed from v.2151  
changed lines
  Added in v.2152

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