This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; ___ _ __ ___ __ ___ | |
; / __|_ _ __ _| |_____ / /| __|/ \_ ) | |
; \__ \ ' \/ _` | / / -_) _ \__ \ () / / | |
; |___/_||_\__,_|_\_\___\___/___/\__/___| | |
; An annotated version of the snake example from Nick Morgan's 6502 assembly tutorial | |
; on http://skilldrick.github.io/easy6502/ that I created as an exercise for myself | |
; to learn a little bit about assembly. I **think** I understood everything, but I may | |
; also be completely wrong :-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public typealias Reducer<Value, Action, Effect> = (inout Value, Action) -> Command<Effect> | |
public final class Store<Value, Action>: ObservableObject { | |
//private let reducer: (inout Value, Action) -> Void | |
private var _send: ((Action) -> Void)? | |
@Published public private(set) var value: Value | |
private var cancellable: Cancellable? | |
// the reducer for the main Store needs to be generic on <Value, Action, Action>, | |
// but other reducers are generic on <Value, Action, Effect> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef id (^fnType0)(); | |
typedef id (^fnType1)(id); | |
typedef id (^fnType2)(id, id); | |
typedef id (^fnType3)(id, id, id); | |
fnType2 cons = ^id(id car, id cdr) { | |
return ^(fnType2 m) { | |
return m(car, cdr); | |
}; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
import Control.Applicative | |
import Control.Monad | |
import System.IO | |
import System.Exit | |
import System.Environment | |
import qualified System.ZMQ as ZMQ | |
import qualified Data.ByteString.UTF8 as SB | |
import qualified Data.ByteString.Char8 as SB | |
import Data.List |