ReasonML: First Look

ReasonML: First Look

1hAdvanced2020-02-28

Authors

J. David Eisenberg

J. David Eisenberg

Programmer and Instructor living in San Jose, California

Course details

Adding type annotations to JavaScript using TypeScript or similar tools can help with basic debugging, but types have much more to offer. ReasonML—a new syntax for OCaml that compiles to JavaScript—offers advanced developers new possibilities for greater readability, performance, and maintainability of code. ReasonML brings the strong typing and functional style of OCaml to the web in a syntax that’s familiar to JavaScript developers.

In this course, join instructor J. David Eisenberg as he details the most salient features of ReasonML. Explore fundamental concepts, including the built-in ReasonML data types and pattern matching. Learn about the ReasonML type system, defining your own data types, and the power of type inference—which lets you write code without having to manually specify types. Plus, take a look at how JavaScript and ReasonML interoperate as you create a ReasonReact project.

Skills covered

ReasonMLLearningProgramming LanguagesOpen SourceSoftware Development

Concepts

Introduction

  • Why ReasonML could be the language for you
  • Base knowledge and setup

ReasonML Fundamentals

  • Variables and data types
  • Functions and annotations
  • Decisions with if and switch expressions
  • Output with Js.log()
  • Challenge - Quadratic formula
  • Solution - Quadratic formula

The ReasonML Type System

  • Creating your own data types
  • Say goodbye to null and undefined
  • Creating modules for reusable code
  • Using collection types
  • Creating record types
  • Challenge - Generating random cakes
  • Solution - Generating random cakes

Interoperating with JavaScript

  • Web pages with ReasonReact

Conclusion

  • Explore ReasonML resources
40,000 Toman