- Seven ineffective coding habits many F# programmers don't have - Yan Cui
- JavaScript Combinators, the 'Six' Edition - Reginald Braithwaite
- Spice up your website with machine learning! - Evelina Gabasova
- Ionide and state of F# open source environment - Krzysztof Cieślak
- The T in TDD: Test, Types, Tales - Mathias Brandewinder
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
defmodule ApplicationRouter do | |
use Dynamo.Router | |
prepare do | |
# Pick which parts of the request you want to fetch | |
# You can comment the line below if you don't need | |
# any of them or move them to a forwarded router | |
conn.fetch([:cookies, :params]) | |
end |
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
module BorrowABook = | |
type BookLoanProblem = | |
NotInCatalogue | |
| OutOnLoan | |
| InsufficientPermission | |
| Failed of string | |
type Book = Book | |
type BookModel = BookModel |
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 static void AddGreeter() | |
{ | |
AddInmemory("Greeter", @"using System; | |
class Greeter | |
{ | |
public string Greet() | |
{ | |
return ""Hello World""; | |
} |
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 Request<'i,'o,'k> = 'i * ('o -> 'k) | |
let bindRequest bind f (s,k) = s, fun v -> bind(k v,f) | |
type Id = int | |
type Entity<'e> = Entity of Id option * 'e | |
[<Measure>] type money | |
type User = {name : string; email : string; ballance : int<money>} | |
type Product = { name : string; quantity : int; price : int<money>} | |
type Email = {body:string; subject : string} |
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 Request<'i,'o,'k> = 'i * ('o -> 'k) | |
let bindRequest bind f (s,k) = s, fun v -> bind(k v,f) | |
type Id = int | |
type Entity<'e> = Entity of Id option * 'e | |
[<Measure>] type money | |
type User = {name : string; email : string; ballance : int<money>} | |
type Product = { name : string; quantity : int; price : int<money>} | |
type Email = {body:string; subject : string} |
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
const reg = new RegExp("([^?=&]+)(=([^&]*))?", "g") | |
function qs (uri) { | |
const obj = {} | |
uri = uri.replace(/^.*\?/, '') | |
uri.replace(reg, map) | |
return obj | |
function map (a0, a1, a2, a3) { | |
obj[decodeURIComponent(a1)] = decodeURIComponent(a3) |
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
var byMonth = R.groupBy(R.prop('Month')); | |
var byAuthor = R.groupBy(R.prop('Author')); | |
var royalty_key = 'Royalty (SUM)'; | |
var months_keys = R.uniq(R.map(R.prop('Month'), data)).sort(); | |
var monthly_revenue = | |
R.map((group) => | |
R.reduce((acc, record) => acc + parseMoney(record[royalty_key]), 0, group), | |
byMonth(data)); |
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 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
/* @flow */ | |
import React from 'react' | |
import ReactDOM from 'react-dom' | |
type FunctionComponent<A> = (props: A) => ?React$Element<any>; | |
type ClassComponent<D, A, S> = Class<React$Component<D, A, S>>; | |
type Component<A> = FunctionComponent<A> | ClassComponent<any, A, any>; |