Update 2 Also tried:
integerToByteString n
| (Builtins.equalsInteger n 0) = "0"
| (Builtins.equalsInteger n 1) = "1"
| (Builtins.equalsInteger n 2) = "2"
| (Builtins.equalsInteger n 3) = "3"
| (Builtins.equalsInteger n 4) = "4"
| (Builtins.equalsInteger n 5) = "5"
| (Builtins.equalsInteger n 6) = "6"
| (Builtins.equalsInteger n 7) = "7"
| (Builtins.equalsInteger n 8) = "8"
| (Builtins.equalsInteger n 9) = "9"
| otherwise = integerToByteString (n `PlutusTx.Prelude.divide` 10) PP.<> integerToByteString (n `PlutusTx.Prelude.modulo` 10)
I keep getting an interpreter error:
GHC Core to PLC plugin: E042:Error: Unsupported feature: Use of Haskell Integer equality, possibly via the Haskell Eq typeclass Context: Compiling expr: GHC.Integer.Type.eqInteger# Context: Compiling expr: GHC.Integer.Type.eqInteger# x Context: Compiling expr: GHC.Integer.Type.eqInteger# x y Context: Compiling expr: case GHC.Integer.Type.eqInteger# x y of wild [Occ=Once] { __DEFAULT -> GHC.Prim.tagToEnum# @ GHC.Types.Bool wild } Context: Compiling expr: \ (y [Occ=Once] :: GHC.Integer.Type.Integer) -> case GHC.Integer.Type.eqInteger# x y of ...