This file contains hidden or 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
| { pkgs, makeWrapper, stdenv, lib, ... }: | |
| let | |
| janet = stdenv.mkDerivation { | |
| name = "spork"; | |
| src = builtins.fetchGit { | |
| url = "https://github.com/janet-lang/janet"; | |
| }; | |
| postPatch = | |
| '' | |
| substituteInPlace janet.1 \ |
This file contains hidden or 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
| (math/seedrandom (os/cryptorand 8)) | |
| (defn rng [upper lower] | |
| (math/round (+ lower (* upper (math/random))))) | |
| (defn random-nth [arr] | |
| (rng (- (length arr) 1) 0)) | |
| (defn split? [money] | |
| (and (> money 0) (= (% money 10) 0))) |
This file contains hidden or 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
| { pkgs ? import <nixpkgs> {} }: | |
| pkgs.haskellPackages.developPackage { | |
| root = ./.; | |
| withHoogle = true; | |
| modifier = drv: | |
| pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages; | |
| [ cabal-install | |
| ghc | |
| haskell-language-server | |
| ]); |
This file contains hidden or 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
| {-# LANGUAGE DataKinds #-} | |
| import qualified Data.Typeable as T | |
| import qualified GHC.Fingerprint as F | |
| import qualified Data.Proxy as P | |
| hashAll :: T.Typeable a => P.Proxy a -> [F.Fingerprint] | |
| hashAll = | |
| let typeReps = collect . T.typeRep | |
| collect :: T.TypeRep -> [T.TypeRep] |
This file contains hidden or 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 formatDate = d => ( d => `${d[1]} ${d[0]} ${d[2]}` )(new Date(d).toDateString().slice(4).split(' ')); |