X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=CoreTools.hs;h=31af5f8914e9f0b2ce95eb104aa20cef0c997c37;hb=7351c9c23660a0217c42483e10ac9b7a25cb49b2;hp=1e71eb14804ee16d6e1ed7b9cb1f8119d7e5cdaf;hpb=19150b91c6ef62bd9d1da7b615b7364532d902d5;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/CoreTools.hs b/CoreTools.hs index 1e71eb1..31af5f8 100644 --- 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 +