The introduction to Reactive Programming you've been missing:
https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
2 minute introduction to Rx:
https://medium.com/@andrestaltz/2-minute-introduction-to-rx-24c8ca793877#.si76lvua0
;; -*- mode: emacs-lisp; lexical-binding: t -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Layer configuration: | |
This function should only modify configuration layer settings." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory | |
;; `+distribution'. For now available distributions are `spacemacs-base' |
deriving instance Generic UIConfig | |
instance AesonOptions UIConfig | |
instance S.Generic UIConfig | |
instance S.HasDatatypeInfo UIConfig | |
instance TS.TypeScript UIConfig | |
-------------------------------------------- | |
-- Instance above errors with: | |
-- No instance for (Data.Aeson.TypeScript.GTypeBody | |
-- '[ '[UIConfigV001], '[[Char]]] | |
-- ('Generics.SOP.Type.Metadata.ADT |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE RecordWildCards #-} | |
module Main where | |
import RIO | |
import qualified RIO.Map as M | |
data Question = Question |
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- | |
;; Place your private configuration here! Remember, you do not need to run 'doom | |
;; sync' after modifying this file! | |
;; Some functionality uses this to identify you, e.g. GPG configuration, email | |
;; clients, file templates and snippets. | |
(setq user-full-name "John Doe" | |
user-mail-address "john@doe.com") |
The introduction to Reactive Programming you've been missing:
https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
2 minute introduction to Rx:
https://medium.com/@andrestaltz/2-minute-introduction-to-rx-24c8ca793877#.si76lvua0
;; -*- mode: emacs-lisp; lexical-binding: t -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Layer configuration: | |
This function should only modify configuration layer settings." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory | |
;; `+distribution'. For now available distributions are `spacemacs-base' |
module NestedListExercise where | |
import Test.QuickCheck | |
import Test.QuickCheck.Monadic | |
------------------------------------------------------------------------------- | |
-- ** Implemetation | |
------------------------------------------------------------------------------- | |
-- I wanted to do this little test using Haskell due to the type safety and how | |
-- we can randomly generate different nested lists to tests against our implementation. |
import Cycle from '@cycle/core'; // the core Cycle | |
import {h, makeDOMDriver} from '@cycle/dom'; // this is a side effect driver | |
import Rx from 'rx'; // RxJS | |
function main({DOM}) { // our Cycle app, it's simple a function | |
const DEFAULT_VALUE = 50; // a default config | |
// we select and watch our slider input from the DOM which is comes in via our function definition | |
// these avents are turned into Rx streams | |
let changeValue$ = DOM.select('#slider').events('input') |
function map (toSomething, obj) { | |
const newObj = {} | |
const keys = Object.keys(obj) | |
for (let i = 0; i < keys.length; ++i) { | |
const name = keys[i] | |
newObject[name] = toSomething(obj[name]) | |
} | |
return newObj | |
} |
,d
88
88,dPYba,,adPYba, ,adPPYba, ,adPPYba, MM88MMM
88P' "88" "8a a8" "8a I8[ "" 88
88 88 88 8b d8 "Y8ba, 88 88 88 88 "8a, ,a8" aa ]8I 88, 88 88 88
"YbbdP"' `"YbbdP"' "Y888
o o o-o o-o o-O-o