tsc && node main.js
"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.
update: this post has been moved to my blog
Welcome! Today I'd like to talk about another subject which can't be emphasized enough: Code Quality. This entails a lot of tools and patterns that ultimately come together to make your game more solid and programmer friendly. Even if you're working alone on a project, these tools can save you some precious debugging time by pointing out simple errors, if not more complex ones. I'll be using my current project, c as an example where possible.
A few notes before we get started:
- Some of the following tools are specific to the JavaScript ecosystem.
- Some of the following tools are only free for open source projects, so bear in mind that you might be missing out on the awesome!
Some of the easiest tools you can set up for your project are JSHint and JSCS. These tools provide basic st
A curated list by Eric Elliott and friends. Suggest links at the original in the comments section or in the website incarnation.
This fork includes screen-captures of the websites, self-descriptions (which appear within quotation marks) from those sites and some metadata like publication date and GitHub stars and forks. It also may lag behind the original as new links are added there. Commentary is almost entirely from Eric Elliott’s original gist: a few summary descriptions were added for sites that omit capsule descriptions.
Help us turn this into a proper website!
This is a very exclusive collection of only must-have JavaScript links. I'm only listing my favorite links. Nothing else makes the cut. Feel free to suggest links if you think they're good
hush :: Either e a -> Maybe a | |
hush = either (const Nothing) Just | |
toId :: JObject -> Maybe Number | |
toId o = fromNumber <|> fromString | |
where | |
fromNumber = hush $ o .? "id" | |
fromString = do | |
s <- hush $ o .? "id" | |
mfilter (isNan >>> not) Just (readFloat s) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)
Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.