Skip to content

Instantly share code, notes, and snippets.

@giogonzo
giogonzo / Money 2.0
Last active December 21, 2015 13:39
var money =
"@people: gio gabro sergio giulio niko\n"+
"@group: gio gabro sergio giulio niko\n"+
"Cibo (gio 85) gio sergio giulio\n"+
"Prodotti pulizia (gio 15) gio sergio giulio\n"+
"Maid (sergio 100) gio sergio giulio niko gabro\n"+
"Tmobile sim cards (gio 35) sergio\n"+
"Chinese delivery (sergio 23) gio sergio\n"+
"Prodotti pulizia (sergio 25) gio sergio giulio\n"+
(defn find-single "you know" [xs] (reduce bit-xor xs))
;; example (find-single [1 2 5 5 2]) => 1
// Porting of the "Arithmetic expressions" example at https://en.wikibooks.org/wiki/Haskell/GADT
// (partially) related TS discussions:
// - https://github.com/microsoft/TypeScript/issues/12424
// - https://github.com/microsoft/TypeScript/issues/17325
// Definition of `Expr` in Haskell using GADTs
// data Expr a where
// I :: Int -> Expr Int
// B :: Bool -> Expr Bool

Keybase proof

I hereby claim:

  • I am giogonzo on github.
  • I am giogonzo (https://keybase.io/giogonzo) on keybase.
  • I have a public key ASBmd6SnWwDizdNMgR8LD0D3UGisQII4h24jwqeHhCLImgo

To claim this, I am signing this object: