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
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
rec { | |
imports = |
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
{-# Language BlockArguments, ExplicitNamespaces, DerivingStrategies, ViewPatterns | |
, NoFieldSelectors, OverloadedRecordDot, DuplicateRecordFields #-} | |
{-# OPTIONS_GHC -main-is Main.test -Wall #-} | |
module Main ( | |
Queue(push, pop, front, back, size, empty), new, onSome, test) where | |
import GHC.Conc (type STM, newTVar, readTVar, writeTVar, retry) | |
import Numeric.Natural (type Natural) |
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
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
module Language.HigherRank.Main | |
( Expr(..) | |
, EVar(..) | |
, Type(..) | |
, TVar(..) | |
, TEVar(..) | |
, runInfer | |
) where |
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
with import <nixpkgs> {}; with builtins; let | |
dfx-env = import (fetchTarball https://github.com/ninegua/ic-nix/releases/latest/download/dfx-env.tar.gz) {}; | |
mops-nix = https://raw.githubusercontent.com/nomeata/ic-certification/3f51849073d19d2ab46aaff3c4985bf8c60196a1; | |
nodeEnv = import (fetchurl "${mops-nix}/mops.nix/node-env.nix") { | |
nodejs = nodejs-14_x; | |
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; | |
inherit pkgs; | |
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null; | |
}; | |
mops = (import (fetchurl "${mops-nix}/mops.nix/node-packages.nix") { |
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
#! /usr/bin/env sh | |
#| | |
exec nix-shell --show-trace --pure -Q -p clisp --run "clisp -q -q $0 ${1+"$@"}" | |
exit | |
|# | |
;; Supposed to be O(letters + total-word * log unique-words) time, | |
;; and slightly less then O(unique-words) space. | |
;; For slower but much more memory efficient version | |
;; alphabetical trees could be useful. |
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
{-# Language GADTs, LambdaCase, PatternSynonyms, QuantifiedConstraints, RoleAnnotations, TypeApplications, StandaloneDeriving, DerivingVia, MultiParamTypeClasses, StandaloneKindSignatures, FlexibleInstances, DataKinds, PolyKinds, TypeFamilies, FlexibleContexts, FunctionalDependencies, ConstraintKinds, AllowAmbiguousTypes, RankNTypes, ScopedTypeVariables #-} | |
import Data.Kind | |
import Data.Coerce (type Coercible) | |
type MyClass :: Type -> Constraint | |
class MyClass t | |
data HtmlT m t |
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
let | |
channel = with builtins; fromJSON | |
(readFile ./lock); | |
in fetchTarball { | |
url = "https://github.com/NixOS/nixpkgs-channels/archive/" + | |
"${channel.rev}.tar.gz"; | |
inherit (channel) sha256; | |
} |
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
#! /usr/bin/env nix-shell | |
#! nix-shell --show-trace --pure -Q -i "runghc --ghc-arg=-main-is --ghc-arg=Solution.main" -p "ghc.withPackages (pkgs: with pkgs; [ either text ])" -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/cf7475d2061ac3ada4b226571a4a1bb91420b578.tar.gz | |
-- You'll need nix to automatically download the dependencies: | |
-- `{ curl https://nixos.org/nix/install | sh ; } && . ~/.nix-profile/etc/profile.d/nix.sh` | |
{-# LANGUAGE OverloadedStrings | |
, PatternSynonyms #-} | |
import Prelude hiding (lookup) |
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
Yan Shkurinskiy, [18/4/22 8:41 AM] | |
foo :: Int -> Int | |
foo x = map fib [0..] !! x | |
where | |
fib 0 = 1 | |
fib 1 = 1 | |
fib n = foo (n-2) + foo (n-1) | |
foo :: Int -> Int | |
foo = (map fib [0..] !!) |
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
(self: super: | |
let | |
# gcc = super.pkgs.gcc8; | |
# gcc8 = super.pkgs.gcc8.override { stdenv = super.stdenv; }; | |
stdenv = super.stdenvAdapters.overrideCC super.stdenv super.pkgs.gcc8; | |
in | |
{ | |
inherit stdenv; # gcc8 gcc; | |
# stdenv = super.overrideCC super.stdenv self.pkgs.gcc; | |
# gcc8 = super.gcc8.override { stdenv = super.stdenv; }; |
NewerOlder