@@ -22,18 +22,16 @@ data Triple = Triple
2222 , triple_b :: CInt
2323 , triple_c :: CInt
2424 }
25+ deriving stock (Eq , Show )
2526
2627instance F. Storable Triple where ...
27- deriving stock instance Show Triple
28- deriving stock instance Eq Triple
2928```
3029
3130## Structures with and without ` typedef `
3231
3332Adding a ` typedef ` matching the name of the structure, or using a ` typedef ` in
3433place of a structure name, does not change the generated bindings. For more
35- details, see the [section on name
36- generation](/ manual/ LowLevel / GeneratedNames. md).
34+ details, see the [ section on name generation] ( 01-GeneratedNames.md ) .
3735
3836``` c
3937typedef struct triple triple;
@@ -47,10 +45,8 @@ typedef struct triple triple_t;
4745
4846``` haskell
4947newtype Triple_t = Triple_t { un_Triple_t :: Triple }
50-
51- deriving newtype instance F. Storable Triple_t
52- deriving stock instance Eq Triple_t
53- deriving stock instance Show Triple_t
48+ deriving stock (Eq , Show )
49+ deriving newtype (Storable )
5450```
5551
5652## Nested structures
@@ -82,7 +78,7 @@ creates the following bindings (instances omitted for brevity):
8278``` haskell
8379data Door = Door
8480 { door_height :: CFloat
85- , door_width :: CFloat
81+ , door_width :: CFloat
8682 }
8783
8884data Room = Room
@@ -135,7 +131,7 @@ struct aula2 {
135131``` haskell
136132data Aula2_door = Aula2_door
137133 { aula2_door_height :: CFloat
138- , aula2_door_width :: CFloat
134+ , aula2_door_width :: CFloat
139135 }
140136
141137data Aula2 = Aula2
@@ -166,11 +162,11 @@ structure in their `Storable` instance:
166162
167163``` haskell
168164data Aula_setup = Aula_setup
169- { aula_setup_window_id :: CChar
170- , aula_setup_tilt :: CInt
165+ { aula_setup_window_id :: CChar
166+ , aula_setup_tilt :: CInt
171167 , aula_setup_close_blinds :: CInt
172168 , aula_setup_projector_id :: CChar
173- , aula_setup_power_mode :: CInt
169+ , aula_setup_power_mode :: CInt
174170 }
175171
176172instance F. Storable Aula_setup where
@@ -304,5 +300,5 @@ foreign import ccall safe "Structs_create_square" create_square
304300 :: CDouble -> IO (Ptr Square)
305301```
306302
307- Note that opaque types do not get a Storable instance, and therefore can not be
303+ Note that opaque types do not get a ` Storable ` instance, and therefore can not be
308304used by value.
0 commit comments