Giter Club home page Giter Club logo

reason-syntax-guide's Introduction

reason-syntax-guide

This guide aims to quickly answer two questions you might get when you encounter unfamiliar syntax in Reason: What is this And where can I learn more? If it doesn't, please make an issue or a PR.

The guide is divided into these sections

Keywords

Keyword Usage What is this? Where can I learn more?
as { foo, bar } as record Binds the item being destructured to a name RWO - OCaml Manual
as array 'a as 'this A type alias OCaml Manual
fun
let
mutable
type
switch
rec
in
to
downto
module
module type
ref
true
false
if
else
for
while
open
exception

Operators and symbols

Operator/Symbol Usage What is this? Where can I learn more?
+., *., etc. 3.1 +. 2.3 Floating point operators
^ "Hello " ^ "world" String concatenation
## obj##property Object (not record) property access
` >` `"hello" > print_string`
@@
=>
` `
'
`
::
{..}
...
;
==
===
!=
!==
_
land
lor
lxor
lnot
lsl
lsr
not
&&
` `
:=

Common user-defined operators

>>= !?

Constructs

Syntax Usage What is this? Where can I learn more?
[a, b, ...c] let a = [1, 2, ...nums] Immutable list append
[_, _, ..._] let [b, c, rest] = a List destructuring
`type _ = _ _`
fun โ” => ...
`switch { => ...`
{..}
{. โ” }
{ "<x>": <y> }
`[ , ]`
[@@...]
[%...]
/* ...*/
<x> ? <y> : <z>
(<x>, <y>)
module <X> (<Y>: <Z>) => ...
<..>

reason-syntax-guide's People

Contributors

glennsl avatar

Stargazers

 avatar Rafa Yepes avatar Khoa Nguyen avatar Kennet Postigo avatar

Watchers

James Cloos avatar Cem Turan avatar Rafa Yepes avatar  avatar

reason-syntax-guide's Issues

Collaborate possibility

Hey I wrote a guide for reason and I think a lot of it has to do with syntax. I would really welcome any additions and suggestions you might be working on. If you are interested and willing to add to it I would open it up so that you can have free reign to edit and add as you want. The best way to collaborate would be on gitbooks.io and what i'm using currently. Is this something you would be interested in?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.