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
| { | |
| allowAliases = false; | |
| allowBroken = false; | |
| allowUnfree = true; | |
| checkMeta = true; | |
| cudaSupport = true; | |
| cudaCapabilities = [ "7.5" ]; | |
| packageOverrides = | |
| pkgs: | |
| let |
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
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| json_cuda_packages_categorized=$(nix eval --impure --json .#cudaPackages --apply ' | |
| attrs: | |
| let | |
| drvKind = drvName: | |
| let | |
| drv = attrs.${drvName}; |
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
| # Clone repositories | |
| FROM docker.io/bitnami/git:2.39.0@sha256:8802a1053f0a75c948da43c0d04e591b500381447745f0b5f75d3cf85509626c as git_base | |
| # Basic git configuration | |
| RUN git config --global advice.detachedHead false \ | |
| && git config --global init.defaultBranch main | |
| # Install xz-utils for decompressing tarballs | |
| RUN --mount=type=cache,target=/var/cache/apt \ | |
| export DEBIAN_FRONTEND=noninteractive \ |
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 TemplateHaskell #-} | |
| module Tasty.Runners.Buildkite.History where | |
| import Tasty.Runners.Buildkite.Span ( Span ) | |
| import Data.Aeson (defaultOptions, camelTo2) | |
| import Data.Aeson.TH (deriveJSON, Options (fieldLabelModifier)) | |
| data History = History { |
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
| rg "(withPackages *=)|(withPlugins *=)" --ignore-case --glob '*.nix' |
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
| fst = (a) -> (b) -> a | |
| snd = (a) -> (b) -> b | |
| _Pair2 = (a) -> (b) -> (p2) -> p2(a)(b) | |
| show_pair = (p2) -> p2((a) -> (b) -> "(${a}, ${b})") | |
| test_p2 = _Pair2('A')('B') | |
| // (A, B) | |
| println(show_pair(test_p2)) | |
| // A | |
| println(test_p2(fst)) |
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 FlexibleInstances #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| module Main where | |
| import Prelude hiding (Maybe (..), concat, fst, head, snd, tail) | |
| -- Church encoding of pair2s | |
| newtype Pair2 a b | |
| = MkPair2 |
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
| reverse :: [α] -> [α] | |
| reverse as = foldr f id as [] | |
| where | |
| f :: α -- Element a to cons to as | |
| -> ([α] -> β) -- Function f which operates on a list | |
| -> [α] -- List as to prepend a to | |
| -> β -- Result of applying function to a : as | |
| f = flip (.) . (:) | |
| -- Application |
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
| module Main where | |
| import qualified Data.Foldable as Foldable | |
| import Data.Map.Strict (Map) | |
| import qualified Data.Map.Strict as Map | |
| import Data.Set (Set) | |
| -- Follow the path a value takes through multiple permutations. | |
| -- If the value is not in the permutation, it is unchanged -- it is fixed. | |
| trace :: Ord a => Map a a -> Map a a -> a -> a |
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 RecordWildCards #-} | |
| module Main where | |
| data Solution = Solution | |
| { remainder :: Integer | |
| , element :: Integer | |
| , power :: Integer | |
| } | |
| instance Show Solution where |