Skip to content

Add an example about phantom types #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mdinger opened this issue Jun 30, 2014 · 5 comments
Closed

Add an example about phantom types #145

mdinger opened this issue Jun 30, 2014 · 5 comments

Comments

@mdinger
Copy link
Contributor

mdinger commented Jun 30, 2014

I tried to add an example about Phantom types at mdinger@b03fc84 which were discussed on the mozilla blog. It definitely doesn't work now because I tried embedding 2 separate live code examples in a single page.

The usefulness of Phantom types is not immediately obvious to me so I thought a better example should be included. However, using that Add there can be confusing and I don't know where all the pieces of it are explained.

The first example became too complicated (long) when I added the second so I tried to split it. Any feedback is welcome. I cobbled it together using IRC for help.

I definitely don't know what you think about my list of cross references included but I tried to include references to the discussed topics anyway. No style was applied either.

@mdinger
Copy link
Contributor Author

mdinger commented Jul 1, 2014

From #144 (comment): Reddit discussed this the other day. It is also mentioned in the old rust cheatsheet though Rust syntax looks a little different. The Haskell documentation for Phantom type is here.

@japaric japaric added the C-taken label Jul 1, 2014
@mdinger
Copy link
Contributor Author

mdinger commented Jul 1, 2014

Examples will now build. Mostly just moved them around: mdinger@dd474e9

@japaric
Copy link
Member

japaric commented Jul 6, 2014

@mdinger Could you send a PR about this change? I can't really test this locally as it is, and that makes it hard for me to review.

@mdinger
Copy link
Contributor Author

mdinger commented Jul 6, 2014

Done: #160

@mdinger
Copy link
Contributor Author

mdinger commented Dec 12, 2014

Fixed by #160

@mdinger mdinger closed this as completed Dec 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants