on master help sign in
Add a "Type variable ordering" section in dev docs
commitde14835852cbf7c64b0bc09a6daa1d664f3a9735 authorAdithya Kumar <adithya@composewell.com> dateThu 29 Jul 2021, 21:41 (5 years ago) parent6179b73
1 file changed+13
CONTRIBUTING.md+13
CONTRIBUTING.md+13
@@ -199,6 +199,19 @@ For general library developer documentation see the `dev` directory.
199199
200200Please see [the Haskell coding style guide](https://github.com/composewell/haskell-dev/blob/master/coding-style.rst).
201201
202+### Type variable ordering
203+
204+Ordering of variables in `forall` may be important in type applications. In
205+streams, we usually declare them in this order `t m a`.
206+
207+Use the same order in constraints as well
208+
209+Example,
210+
211+```
212+func :: forall m a. (MonadIO m, Storable a) => ...
213+```
214+
202215### StreamD coding style
203216
204217Some conventions that we follow in the StreamD code are illustrated by the