Skip to content
Browse files

+ Computing size of expressions

  • Loading branch information...
1 parent 9106906 commit ddd5fcac0f787fa490c6f6838c1d20d508bcbc69 @Averethel committed Feb 19, 2013
Showing with 13 additions and 0 deletions.
  1. +13 −0 Inline/Size.hs
View
13 Inline/Size.hs
@@ -0,0 +1,13 @@
+module Inline.Size where
+ import KNormal.KSyntax
+
+ size :: KExpr -> Integer
+ size (KEifEq _ _ e1 e2) = 1 + size e1 + size e2
+ size (KEifLE _ _ e1 e2) = 1 + size e1 + size e2
+ size (KElet _ e1 e2) = 1 + size e1 + size e2
+ size (KEletRec fd e) = 1 + size e + size (body fd)
+ size (KEletPair _ _ _ e) = 1 + size e
+ size (KEletList _ _ _ e) = 1 + size e
+ size (KEhandle e1 e2) = size e1 + size e2
+ size (KEseq e1 e2) = size e1 + size e2
+ size _ = 1

0 comments on commit ddd5fca

Please sign in to comment.
Something went wrong with that request. Please try again.