Comments (7)
I'm working on this.
from reason.
A newline between type definitions and between modules helps a lot with readability. The one exception I can think of is recursively defined types (type a and type b
).
from reason.
Gonna bump this a bit. At least a space between different item types "e.g. types vs let" inside modules would be nice.
from reason.
Cool, I've wanted this for a long time!
from reason.
I've got some questions:
- Should variants & extensible variants be seen as the same group?
module NottyString = {
type props = {
attr,
text: string,
style: LayoutSupport.LayoutTypes.cssStyle,
children: list element
};
type tag 'props +=
| StringTag :tag props;
let createElement ::attr=A.empty ::style=LayoutSupport.defaultStyle ::text children =>
NativeElement StringTag {attr, text, style, children};
};
- Should we group
modules
,module types
and/orclasses
?
Example:
module NottyString = {
type props = {
attr,
text: string,
style: LayoutSupport.LayoutTypes.cssStyle,
children: list element
};
type tag 'props +=
| StringTag :tag props;
let createElement ::attr=A.empty ::style=LayoutSupport.defaultStyle ::text children =>
NativeElement StringTag {attr, text, style, children};
};
module Div = {
type props = {style: LayoutSupport.LayoutTypes.cssStyle, children: list element};
type tag 'props +=
| VoidTag :tag props;
let createElement ::style=LayoutSupport.defaultStyle children =>
NativeElement VoidTag {style, children};
};
There's no spacing between module definition NottyString
& module definition Div
.
from reason.
FWIW, I put a blank line after any item that takes more than one line--type definitions, modules, bindings, etc.
from reason.
fixed!
from reason.
Related Issues (20)
- Empty Functor adds unit on declaration and empty module on instantiation HOT 1
- local open + let bindings HOT 1
- Comments and opens HOT 2
- module types with one line and attribute prints in one line instead of two HOT 1
- Release process HOT 2
- Polyvariants following printing as variants
- Upgrade menhir to recent version HOT 2
- cannot build 3.9.0 with esy HOT 5
- refmt removes parents leading to invalid code HOT 2
- Application with comment, breaks into newline HOT 1
- Refmt doesn't break the line when an extra long string occurs in switch branch
- Rfmt mangles partial application of operators HOT 1
- Support for "string" [@JSX] HOT 2
- Support for `external%foo`
- Investigate potential outcometree bug
- Pattern-matching of `bool` value is formatted to ternary if we match `true` first HOT 3
- Open module from another directory HOT 1
- Merlin infers wrong types for labelled optional arguments in 5.2
- Formatting destructured record with letops results in a syntax error
- outcome printer: `test/class.t` tests show failure
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reason.