Skip to content

Instantly share code, notes, and snippets.

View leomayleomay's full-sized avatar

Hao Liu leomayleomay

View GitHub Profile
@leomayleomay
leomayleomay / PhantomTypeReasonML.md
Created March 9, 2018 22:31 — forked from busypeoples/PhantomTypeReasonML.md
Phantom types in ReasonML

Phantom types in ReasonML

Introduction

"A phantom type is a parametrised type whose parameters do not all appear on the right-hand side of its definition..." Haskell Wiki, PhantomType

The following write-up is intended as an introduction into using phantom types in ReasonML.

Taking a look at the above definition from the Haskell wiki, it states that phantom types are parametrised types where not all parameters appear on the right-hand side. Let's try to see if we can implement a similar example as in said wiki.