Skip to content
Lars Hummelgren edited this page Feb 8, 2022 · 5 revisions

We have agreed upon the following conventions:

MCore

  • Naming should follow the CamelCase style
  • Types are written as uppercase (CamelCase), e.g. MyType
  • Type parameters should be lowercase, e.g. a
  • Identifiers are written lowercase (camelCase), e.g. myIdentifier
  • Source code width should be limited to 80 characters unless there is a good reason to exceed this.
  • Indentation should be done with 2 spaces.
  • File names should be written with dashes, e.g., long-named-file.mc.
  • Partial functions should either return an option to make them total or follow the naming convention myFunOrElse, where the first argument should have type (Unit -> a) and should be applied to () on undefined input.
  • Use the following categories for comments
    -- TODO(vipa, 2020-09-17): this is something that should be done. These should not live
    -- for a very long time
    
    -- NOTE(vipa, 2020-09-17): this is something that might be surprising about the code,
    -- something about why things are done the way they are. These likely live for a long time.
    
    -- OPT(vipa, 2020-09-17): this is a likely place for optimization down the line. These may
    -- well live for a while.
    

OCaml

  • Variables, functions, and types should follow snake_case, while constructors use CamelCase.
  • Source code width should be limited to 80 characters unless there is a good reason to exceed this.
  • Indentation should be done with 2 spaces.