Skip to content

Instantly share code, notes, and snippets.


Adam Recvlohe arecvlohe

View GitHub Profile
Phate6660 / rust recommendations and
Last active Jan 10, 2021
My growing list of Rust programs to use.
View rust recommendations and
IanColdwater / twittermute.txt
Last active Jan 13, 2021
Here are some terms to mute on Twitter to clean your timeline up a bit.
View twittermute.txt
Mute these words in your settings here:
broerjuang /
Created Sep 15, 2019
An experiment using state machine using ReasonML
open ReactUpdate;
type context = {
rate: int,
comment: string,
type action =
| Open
| Close
abenoit /
Last active Apr 3, 2019
ReasonML Binding for react-click-outside
[@bs.module "react-click-outside"]
external clickOutside: ReasonReact.reactClass = "default";
[@bs.deriving abstract]
type jsProps = {
className: option(string),
onClickOutside: ReactEvent.Mouse.t => unit,
let make = (~className=?, ~onClickOutside, children) =>
joshburgess / flatten.js
Last active Feb 10, 2018
Solutions showing how to flatten arbitrarily nested arrays of ints in JavaScript
View flatten.js
// shorthand function for the Number.isInteger method
const isInt = Number.isInteger
// shorthand function for the Array.isArray method
const isArray = Array.isArray
// functional wrapper for the Array.reduce method
const reduce = f => initVal => arr => arr.reduce(f, initVal)
// functional wrapper for the Array.concat method
View ReasonReact.dockerfile
FROM node:6
RUN npm install -g bs-platform
RUN yarn global add serve
# Copy just the package.json first to install deps
ADD src/package.json /app/package.json
RUN npm install
kumekay /
Last active Jun 23, 2020 — forked from nerdyworm/
rename a phoenix 1.3 project
set -e
busypeoples /
Last active Nov 28, 2020
Phantom types in ReasonML

Phantom types in ReasonML


"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.

kritzcreek /
Last active May 9, 2020
Collections of random numbers in PureScript

Generating collections of random numbers in PureScript

A problem that I've seen beginners run into in Haskell or PureScript a couple of times now is how to generate a List of random numbers. It's a common requirement for little games (which make for great first projects) to generate these, and it definitely seems to be a stumbling block.

Why are random numbers hard?

Randomness is considered a side effect in purely functional languages, which means that to generate them you usually need access to Eff/IO, which in turn means we need to deal with Monads. And while generating a single random number is usually pretty easy with do-notation, the typical intuition beginners have built when going from single values to a collection is to use map, but that fails.

Type-Directed-Search to the rescue

justinwoo /
Last active Mar 25, 2020
This document is likely out of date. See this page for general information: Differences of Purescript from Elm (The resource that I wish I had when starting with Purescript, or when revisiting Elm)

Differences of Purescript from Elm

The syntax between Elm and Purescript are mostly the same, to the point where most Elm code can be converted to Purescript with copy-pasting and find-replace/multi-cursor editing.

Purpose of this document

Many people who have used Elm who are curious about/have tried/are using Purescript have asked me to put together a "differences from Elm" post to help them, and which I would also have found helpful.

Type Annotations

You can’t perform that action at this time.