- ReasonML Quick Start Guide
- Raphael Rafatpanah Bruno Joseph D'mello
- 211字
- 2021-07-02 12:34:13
Type system
Reason's type system is sound, which means that, once compiled, there won't be runtime type errors. There is no null in the language, nor are there any bugs related to null. In JavaScript, when something is of the number type, it can also be null. Reason uses a special type for things that can also be null, and forces the developer to handle those cases appropriately by refusing to compile otherwise.
So far, we've already written some, albeit basic, Reason code without even talking about types. Reason infers types automatically. As we'll learn throughout this book, the type system is a tool that provides guarantees without getting in our way, and when used properly, can allow us to offload things to the compiler that we used to keep in our heads.
Reason's support for immutable programming, sound type system, and sophisticated module system are big parts of why Reason is so great, and there's something to be said about using all of these features together in one language that was built with these features in mind. When Facebook initially released React, they asked us to give it five minutes (https://signalvnoise.com/posts/3124-give-it-five-minutes) and, hopefully, that same frame of mind will pay off here as well.
- 萬物互聯(lián):蜂窩物聯(lián)網(wǎng)組網(wǎng)技術(shù)詳解
- HTML5 Game development with ImpactJS
- 正在爆發(fā)的互聯(lián)網(wǎng)革命
- 射頻通信系統(tǒng)
- 物聯(lián)網(wǎng)與無線傳感器網(wǎng)絡(luò)
- Mastering JavaFX 10
- CCNP TSHOOT(642-832)認(rèn)證考試指南
- 6G新技術(shù) 新網(wǎng)絡(luò) 新通信
- WordPress Web Application Development
- Working with Legacy Systems
- 工業(yè)互聯(lián)網(wǎng)創(chuàng)新實(shí)踐
- AIoT應(yīng)用開發(fā)與實(shí)踐
- 商業(yè)的本質(zhì)和互聯(lián)網(wǎng)
- Building Microservices with Spring
- Hands-On Cloud:Native Microservices with Jakarta EE