projects
/
matthijs
/
master-project
/
cλash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19150b9
)
Add sized_word_len, which gets the length from a SizedWord type.
author
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Thu, 9 Apr 2009 15:58:59 +0000
(17:58 +0200)
committer
Matthijs Kooijman
<m.kooijman@student.utwente.nl>
Thu, 9 Apr 2009 15:58:59 +0000
(17:58 +0200)
CoreTools.hs
patch
|
blob
|
history
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
+