-
-
Notifications
You must be signed in to change notification settings - Fork 44
Felix Style Guide
skaller edited this page Apr 13, 2011
·
2 revisions
(Partially cribbed from Scala style guide for now).
Indentation should follow the "2-space convention". This:
fun foo (x:int) = { val y = x + 1; return y; }
Not this:
fun foo (x:int) = { val y = x + 1; return y; }
No tab characters.
Indent 2 lines:
val result = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 2 ;
Lower case, use underscores for multiword names.
Single upper letter.
fun f[U,V] (x:U, y:V) => x,y;
Use type deduction as much as possible. This:
val x = 5;
Not this:
val x:int = 5;
Function and procedure types should be declared with a space between the parameter type, the arrow, and the return type.
fun foo (f: int -> string): int = { .. } proc bar (f: (bool * double) -> string) { ...}