- 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.
- C++黑客編程揭秘與防范
- 高校網(wǎng)絡(luò)道德教育研究
- 信息通信網(wǎng)絡(luò)建設(shè)安全管理概要2
- Wireshark網(wǎng)絡(luò)分析就這么簡單
- 計算機網(wǎng)絡(luò)工程實用教程(第2版)
- 新手易學(xué):新手學(xué)淘寶開店
- 網(wǎng)管第一課:網(wǎng)絡(luò)操作系統(tǒng)與配置管理
- 端到端QoS網(wǎng)絡(luò)設(shè)計
- 組網(wǎng)技術(shù)與網(wǎng)絡(luò)管理
- 一本書讀懂TCP/IP
- 物聯(lián)網(wǎng)基礎(chǔ)及應(yīng)用
- 智慧城市中的物聯(lián)網(wǎng)技術(shù)
- 物聯(lián)網(wǎng)
- SEO攻略:搜索引擎優(yōu)化策略與實戰(zhàn)案例詳解
- 物聯(lián)網(wǎng)技術(shù)與實踐