Skip to content

Instantly share code, notes, and snippets.

View ThomasCrevoisier's full-sized avatar

Thomas Crevoisier ThomasCrevoisier

View GitHub Profile
module Main where
import Control.Monad.State.Lazy
data AppState = AppState {
_appCount :: Int
, _appActions :: [String]
} deriving Show
data Action
module Main where
import Control.Monad.State.Lazy
data AppState = AppState {
_appCount :: Int
, _appActions :: [String]
} deriving Show
data Action
module Main where
import Prelude hiding (div)
import Control.Monad.Eff (Eff)
import Pux (CoreEffects, EffModel, start)
import Pux.DOM.Events (onClick)
import Pux.DOM.HTML (HTML)
import Pux.Renderer.React (renderToDOM, renderToReact)
import Text.Smolder.HTML (button, div, span)
import Text.Smolder.Markup (text, (#!))
// The proposal
const doubleSay = str => str + ', ' + str;
const capitalize = str => str[0].toUpperCase() + str.substring(1);
const exclaim = str => str + '!';
let result = "hello"
|> doubleSay
|> capitalize
|> exclaim

Idées de posts en vrac :

  • Utilises l'inférence de type Luke (explications du Hindley-Milner type system)
  • Quickcheck et le property based testing, ou comment apprendre de tes outils
  • Parser combinator, comment s'amuser quand on n'a pas de Legos sous la main
  • La (dé)sérialisation avec Aeson sans se prendre la tête
@ThomasCrevoisier
ThomasCrevoisier / mongo_assertion.js
Last active December 19, 2017 17:24
Run assertion on a mongo collection
const MongoClient = require("mongodb").MongoClient;
const test = require("tape");
function connect (url) {
return new Promise((resolve, reject) => {
MongoClient.connect(url, function (err, db) {
if (err) {
reject(err);
} else {
resolve(db);