@@ -1017,25 +1017,22 @@ \subsection{\te{data}}
1017
1017
Error messages involving data type definitions sometimes show traces
1018
1018
of how they are handled internally. Data type definitions are
1019
1019
translated into a data type where each constructor has exactly one
1020
- argument. Each argument is a struct type. The types above translate
1020
+ argument. The types above translate
1021
1021
to:
1022
1022
\begin {verbatim }
1023
1023
data Bool = False PrimUnit | True PrimUnit
1024
1024
1025
- data Operand = Register Operand.Register
1026
- | Operand.Literal
1027
- | Operand.Indexed
1028
- struct Operand°Register = { _1 :: Bit 5 }
1029
- struct Operand°Literal = { _1 :: Bit 22 }
1030
- struct Operand°Indexed = { _1 :: Reg 5; _2 :: Reg 5 }
1025
+ data Operand = Register (Bit 5)
1026
+ | Literal (Bit 22)
1027
+ | Indexed Operand_$Indexed
1028
+ struct Operand_$Indexed = { _1 :: Reg 5; _2 :: Reg 5 }
1031
1029
1032
- data Maybe a = Nothing PrimUnit | Maybe.Just a
1033
- struct Maybe.Just a = { _1 :: a }
1030
+ data Maybe a = Nothing PrimUnit | Just a
1034
1031
1035
- data Instruction = Immediate Instruction° Immediate |
1036
- Register Instruction° Register
1037
- struct Instruction° Immediate = { op::Op; rs::Reg; rt::CPUReg; imm::UInt16; }
1038
- struct Instruction° Register = { op::Op; target::UInt26; }
1032
+ data Instruction = Immediate Instruction_$ Immediate
1033
+ | Register Instruction_$ Register
1034
+ struct Instruction_$ Immediate = { op::Op; rs::Reg; rt::CPUReg; imm::UInt16; }
1035
+ struct Instruction_$ Register = { op::Op; target::UInt26; }
1039
1036
\end {verbatim }
1040
1037
\end {NOTE }
1041
1038
0 commit comments