Skip to content
This repository has been archived by the owner on Oct 28, 2019. It is now read-only.

Commit

Permalink
Add note about phantom types
Browse files Browse the repository at this point in the history
  • Loading branch information
rl-king committed Jun 11, 2019
1 parent 6261e78 commit 9620ad3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Data/Id.elm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ import Url.Parser as Url
-- DEFINITIONS


{-| Note that `Id a` does not contain a value `a` at all,
this is called a phantom type, it's a dummy variable that
let's us tag `Id` with another type.
Learn more about this here:
<https://medium.com/@ckoster22/advanced-types-in-elm-phantom-types-808044c5946d>
-}
type Id a
= Id String

Expand Down

0 comments on commit 9620ad3

Please sign in to comment.