X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=CoreTools.hs;h=3d3828b45b8c150d4c552759e6202a590a21c7fa;hb=998e440a7fa765685e1ed500c871058a33129b1f;hp=06b7a62388a4c00446737e026bed7e03bf974d4b;hpb=8f26d216ad75c8e6cb017ae8b0f5e6f1cd62f505;p=matthijs%2Fmaster-project%2Fc%CE%BBash.git diff --git a/CoreTools.hs b/CoreTools.hs index 06b7a62..3d3828b 100644 --- a/CoreTools.hs +++ b/CoreTools.hs @@ -69,3 +69,11 @@ eval_type_level_int ty = core <- toCore [] app execCore core + +-- | Get the length of a FSVec type +fsvec_len :: Type.Type -> Int +fsvec_len ty = + eval_type_level_int len + where + (tycon, args) = Type.splitTyConApp ty + [len, el_ty] = args