- let possibilaties = case (length dcs) of 1 -> 1; x -> (x-1)
- let bitsize = floor (logBase 2 (fromInteger (toInteger possibilaties)))
- let range = AST.ConstraintIndex $ AST.IndexConstraint [AST.DownRange (AST.PrimLit $ show bitsize) (AST.PrimLit "0")]
- let ty_def = AST.SubtypeIn unsignedTM (Just range)
+ let range = AST.SubTypeRange (AST.PrimLit "0") (AST.PrimLit $ show (length dcs))
+ let ty_def = AST.TDI $ AST.IntegerTypeDef range