Skip to content

Commit c4943c9

Browse files
authored
Update typespecs-and-behaviours.markdown (#1688)
1 parent 4183ffc commit c4943c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

getting-started/typespecs-and-behaviours.markdown

+2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ end
142142

143143
Modules adopting the `Parser` behaviour will have to implement all the functions defined with the `@callback` attribute. As you can see, `@callback` expects a function name but also a function specification like the ones used with the `@spec` attribute we saw above. Also note that the `term` type is used to represent the parsed value. In Elixir, the `term` type is a shortcut to represent any type.
144144

145+
`@callback` was initially for callbacks only. Then the idea evolved and people started using them for contract-driven programming.
146+
145147
### Adopting behaviours
146148

147149
Adopting a behaviour is straightforward:

0 commit comments

Comments
 (0)