Skip to content

Instantly share code, notes, and snippets.

//module Main
var fs = require('fs');
var request = require('request');
var cheerio = require('cheerio');
var spawn = require('child_process').spawn;
var path = require('path');
var chalk = require('chalk');
var CONFIG_PATH = './config.json';
module Main (..) where
import String
import Json.Decode exposing (Value)
type alias File =
String
@justinwoo
justinwoo / durr.purs
Last active August 3, 2017 20:55
wip as heck
module ChocoPie where
import Prelude
import Control.Monad.Eff (Eff, kind Effect)
import Data.Record (delete, get, insert)
import Data.Symbol (class IsSymbol, SProxy(..))
import FRP (FRP)
import FRP.Event (Event, create)
import Type.Equality (class TypeEquals, from, to)
@justinwoo
justinwoo / main.purs
Last active August 1, 2017 10:51
Let's map a function to all the fields of a record!!!
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Data.Record (delete, get, insert)
import Global.Unsafe (unsafeStringify)
import Type.Prelude (class IsSymbol, class RowLacks, class RowToList, RLProxy(RLProxy), SProxy(SProxy))
import Type.Row (Cons, Nil, kind RowList)
@justinwoo
justinwoo / Main.js
Last active July 26, 2017 17:20
mystery box action, i don't know what i'm doing
exports.getMysteryBox_ = function () {
return {};
};
exports.unsafeSetMysteryBox = function (key) {
return function (value) {
return function (record) {
return function () {
record[key] = value;
return void 0;
@justinwoo
justinwoo / yup.purs
Created July 14, 2017 08:59
because redux is godawful
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Data.Array (head, tail)
import Data.Char as C
import Data.Foldable (intercalate)
import Data.Generic.Rep (class Generic, Constructor)
@justinwoo
justinwoo / read-record.purs
Last active July 13, 2017 17:11
read a record from a JSON string through the Foreign object!
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, log)
import Control.Monad.Except (runExcept)
import Data.Either (Either(..))
import Data.Foreign (F, Foreign, readInt, readString)
import Data.Foreign.Index (readProp)
@justinwoo
justinwoo / extract-fieldnames.purs
Last active April 22, 2018 15:02
extract field names from rows using rowtolist
module Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, logShow)
import Data.Symbol (class IsSymbol, SProxy(..), reflectSymbol)
import Type.Proxy (Proxy(..))
import Type.Row (class ListToRow, class RowToList, Cons, Nil, kind RowList)
@justinwoo
justinwoo / purescript-reactive-programming-notes.md
Last active March 30, 2021 14:01
Purescript Reactive Programming options

Here are some of the examples of Reactive Programming libraries I've found in Purescript and what I've thought about them so far:

I've never used a library with truly continuous Behaviors, so this was really neat to try out for me. Really nice to use and comes with utilities for working with browser events already, and gives you good Event modules for picking your sampling options as necessary.

I will probably use this library for all of my future uses.

module Main where
import Prelude
import Control.MonadPlus (guard)
import Control.Monad.Eff.Console (logShow)
import Data.Array ((..))
import Data.Foldable (for_)
import TryPureScript
import Data.Symbol
import Data.Generic.Rep