- Nothing ->
- let
- ty = Var.varType var
- res = case Type.splitTyConApp_maybe ty of
- Just (tycon, args) ->
- case Name.getOccString (TyCon.tyConName tycon) of
- "Dec" -> AST.PrimLit $ (show (fst ( State.runState (tfp_to_int ty) ty_state ) ) )
- otherwise -> AST.PrimName $ AST.NSimple $ varToVHDLId var
- in
- res
-
+ Nothing -> do
+ let ty = Var.varType var
+ case Type.splitTyConApp_maybe ty of
+ Just (tycon, args) ->
+ case Name.getOccString (TyCon.tyConName tycon) of
+ "Dec" -> do
+ len <- tfp_to_int ty
+ return $ AST.PrimLit $ (show len)
+ otherwise -> return $ AST.PrimName $ AST.NSimple $ varToVHDLId var