| Scalaz | |||
| Symbol | Code | Ascii | Example |
|---|---|---|---|
| η | 951 | pure | 1.η[List] |
| μ | 03BC | join | List(List(1,2,3), nil, List(5,6,7)) μ |
| ∅ | 2205 | zero | ∅[Int] |
| <∅> | empty | <∅>[Option, Int] |
|
| ∙ | 2219 | contramap | ((_:String).length ∙ (_:Int).toString ∙ ((_:Int) + 6))(5) |
| ∘ | 2218 | map | (((_:Int) + 6) ∘ (_:Int).toString ∘ (_:String).length)(5) |
| ∘∘ | |||
| {-# LANGUAGE GADTs, TypeOperators, TupleSections #-} | |
| module Generics.Algebra where | |
| import Control.Category | |
| import Control.Arrow | |
| import Control.Applicative | |
| import Prelude hiding ((.), id) | |
| import Generics.Combinator |
| {-# LANGUAGE NoMonomorphismRestriction #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# OPTIONS_GHC -fwarn-missing-methods #-} | |
| module Err where | |
| import Control.Lens | |
| import Control.Monad.Error | |
| import Control.Monad.Error.Lens | |
| -- Here is a fairly typical situation, where we have low level errors in certain |
| function docker-compose() { | |
| if ($pwd.Path.StartsWith('C:\Users')) { | |
| $projectName = Split-Path "$pwd" -leaf | |
| $dockerPath = "/c" + $($($pwd -replace "^[a-z]:(.*)$",'$1') -replace "\\","/") | |
| $dockerCmd = "docker run -v $dockerPath" + ":/$dockerPath -w $dockerPath -v /var/run/docker.sock:/var/run/docker.sock -e COMPOSE_PROJECT_NAME=$projectName -ti --rm dduportal/docker-compose:latest $args" | |
| Write-Host $dockerCmd | |
| Invoke-Expression $dockerCmd | |
| } else { | |
| Write-Error 'You must be under C:\Users, otherwise fileshare to boot2docker will not work!' | |
| } |
Disclaimer 1: Type classes are great but they are not the right tool for every job. Enjoy some balance and balance to your balance.
Disclaimer 2: I should tidy this up but probably won’t.
Disclaimer 3: Yeah called it, better to be realistic.
Type classes are a language of their own, this is an attempt to document features and give a name to them.
JoinMarket has a problem where it assumes different nicknames have different bitcoin wallets. This can be exploited by people running multiple yield generator bots from the same wallet, so they get a higher rate of profit at the expense of de-legitimizing the system for privacy.
A merkle tree is a way of producing a commitment to a set, which can later can prove that elements are contained within the set using only O(logN) data, and only revealing one other element in the set.
For example here is a merkle tree commiting to a set of numbers {6, 3, 9, 0, 8, 4, 7, 2}
| const echarts = require("echarts"); | |
| const Canvas = require('canvas'); | |
| const {JSDOM} = require('jsdom'); | |
| const fs = require('fs'); | |
| echarts.setCanvasCreator(() => { | |
| return new Canvas(100, 100); | |
| }); | |
| const {window} = new JSDOM(); | |
| global.window = window; |