https://github.com/paldepind/flyd
License: MIT
Size: 22.4 KB (3.4 KB gzip)
Functions: 16
Project Life: Good
Stars: 1129
Code Quality: Good Functional/Procedural
Comments: JSDoc
Quality Automation: Extensive unit tests, CI
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
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>> | |
/* Source: https://github.com/Microsoft/TypeScript/pull/21316#issuecomment-364982638 */ | |
type DiscriminateUnion<Union, TagKey extends keyof Union, TagValue extends Union[TagKey]> = | |
Union extends Record<TagKey, TagValue> ? Union : never | |
type MatchingFunc<A extends { kind: string }, K extends A['kind'], U> = (a: Omit<DiscriminateUnion<A, 'kind', K>, 'kind'>) => U | |
function match<A extends { kind: string }>(discriminant: A) { |
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
import { class, interface, implements } from 'sweet-interfaces'; | |
const constant = x => _ => x; | |
const identity = x => x; | |
const flip = f => (a, b) -> f(b, c); | |
interface Setoid { | |
// eq :: Setoid a => a ~> a -> Boolean | |
eq(b) { return this === b; } | |
} |
This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
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
arg |> foo[0].bar(42) | |
|> baz("hello", "there") | |
|> quux.foo().bar() | |
|> new Foo() | |
// Expands to: | |
// new Foo(quux.foo().bar(baz('hello', 'there', foo[0].bar(42, arg)))); | |
arg |> foo() |> bar | |
// SyntaxError: [|>] Expected function call | |
// 31: arg |> foo() |> bar |
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
macro $if { | |
case ($x ...) => { if (relCar($x ...)) } | |
} | |
macro $while { | |
case ($x ...) => { while (relCar($x ...)) } | |
} | |
// naive form: | |
/* |
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
/* | |
F'n Sweet Grid system | |
Reduced fluid version of http://960.gs with fixed-width gutters | |
No support for < IE8 | |
Basic usage: | |
In some stylesheet: | |
@include grid(); | |
In your html: | |
<div class="container"> | |
<div class="grid_4">4</div> |
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
sys = require 'sys' | |
fs = require 'fs' | |
util = require 'util' | |
childProc = require 'child_process' | |
coffee = require 'coffee-script' | |
stylus = require 'stylus' | |
uglify = require 'uglify-js' | |
_ = require 'underscore' | |
_.mixin(require('underscore.string')) |