Autogenerated Screenshots in Markdown
nicolodavis.com2 pointsby nicolodavis0 comments
set of cards -> filter by action cards -> choose -> [card]
do stuff with [card]
written in a synchronous style, while under the hood it: {-# LANGUAGE ExistentialQuantification #-}
newtype Rule a = Rule {fn :: State -> (RuleResult a, State)}
data RuleResult a
= Done a
| forall x. Show x => Choose [x] (x -> Rule a)
instance Monad Rule where
m >>= k = Rule $ \state ->
case fn m state of
(Done a, state') -> fn (k a) state'
(Choose list m', state') -> (Choose list (m' >=> k), state')
i.e. each rule returns either a completed result or a choice along with a continuation of the remainder of the rule past that choice. interface MyType {
a: number;
}
function process(value: MyType) {
console.log(value);
}
const value = { a: 1, b: 2 };
process(value);
boardgame.io - MIT licensed open-source JS library.
boardgamelab.app - Proprietary platform for designing and playtesting board games.