Skip to content

Instantly share code, notes, and snippets.

Federico Sordillo fes300

View GitHub Profile
View solutionWithTaskEither.ts
const getDocsByRole = (
role: string
): ReaderTaskEither<DocsRequestStrict, t.Errors, Document[]> =>
ask<DocsRequestStrict, Errors>().chain(({ limit }) =>
fromTaskEither(
new TaskEither(
new Task(() =>
db
.collection("documents")
.where("roles", "array-contains", role)
View problem.purs
overlap :: Int -> Int -> Int -> Int -> Boolean
overlap a b c d = (c < b && d > a) || (d > a && c < b)
instance tupleInt :: Semigroup IntTuple where
append (IntTuple (Tuple a b)) (IntTuple (Tuple c d)) =
if (overlap a b c d)
then IntTuple $ Tuple (min a c) (max b d)
else IntTuple $ Tuple a b
sanitizeTupleList' :: List IntTuple -> List IntTuple
@fes300
fes300 / reactSnippet.json
Last active Oct 16, 2018
snippet for VSCode
View reactSnippet.json
{
"Create basic React class": {
"prefix": "rcc",
"body": [
"import * as React from 'react'",
"",
"type Props = {}",
"",
"type State = {}",
"",
You can’t perform that action at this time.