Data, newtype, and type changes
@LiamGoodacre showed an example of formatting (maybe accidentally) that seems nicer for data, newtype and type declarations. Copying a some of it here for posterity:
data Sum
(left :: (Type -> Type) -> ((Type -> Type) -> Type) -> Type)
(right :: (Type -> Type) -> ((Type -> Type) -> Type) -> Type)
(context :: Type -> Type)
(rec :: (Type -> Type) -> Type) =
L (left context rec) |
R (right context rec)
newtype Lit
(context :: Type -> Type)
(rec :: (Type -> Type) -> Type) =
Lit
Int
type Exp =
Lit :+:
Lam :+:
Var :+:
App
The important bits are:
- The
=
always ends the line - The thing being defined is always indented one step
- Alternates in
data
are suffixed - Operators are used as suffixes (might be the same rule as the built in
|
operator).
There's probably more. But we should see how this works out.
Edited by Hardy Jones