X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=CoreTools.hs;h=0dee4715f7ed55e5f58ba7ae3527799f60166feb;hb=91914df9b344ccf0bc3242dc28ce74a8d6721944;hp=a8dce3fab43ac345762307704a27b6d1e31592b3;hpb=8a17f35807fb35ee4d2a4c35c75e1cf99066f94d;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/CoreTools.hs b/CoreTools.hs index a8dce3f..0dee471 100644 --- a/CoreTools.hs +++ b/CoreTools.hs @@ -58,6 +58,14 @@ sized_word_len ty = where (tycon, args) = Type.splitTyConApp ty [len] = args + +-- | Get the upperbound of a RangedWord type +ranged_word_bound :: Type.Type -> Int +ranged_word_bound ty = + eval_tfp_int len + where + (tycon, args) = Type.splitTyConApp ty + [len] = args -- | Evaluate a core Type representing type level int from the TypeLevel -- library to a real int.