projects
/
matthijs
/
master-project
/
cλash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Move some code out of the flattenExpr to global scope.
[matthijs/master-project/cλash.git]
/
CoreTools.hs
diff --git
a/CoreTools.hs
b/CoreTools.hs
index 1e71eb14804ee16d6e1ed7b9cb1f8119d7e5cdaf..31af5f8914e9f0b2ce95eb104aa20cef0c997c37 100644
(file)
--- a/
CoreTools.hs
+++ b/
CoreTools.hs
@@
-41,3
+41,12
@@
eval_tfp_int ty =
core <- toCore expr
execCore core
+
+-- | Get the length of a SizedWord type
+sized_word_len :: Type.Type -> Int
+sized_word_len ty =
+ eval_tfp_int len
+ where
+ (tycon, args) = Type.splitTyConApp ty
+ [len] = args
+