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
| import Data.List (unfoldr, partition) | |
| import Data.Maybe (catMaybes) | |
| import Criterion.Main (defaultMain, env, bgroup, bench, nf) | |
| import System.Random (randomIO) | |
| import Control.Monad (replicateM) | |
| groupOn :: Eq k => (a -> k) -> [a] -> [(k, [a])] | |
| groupOn k = unfoldr f . map (\x -> (k x, x)) | |
| where | |
| f [] = Nothing |
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
| :- use_module(library(pairs)). | |
| :- use_module(library(reif)). | |
| not_in_list(K, L) :- | |
| if_((L = []), | |
| true, | |
| ([X | More] = L, | |
| dif(K, X), | |
| not_in_list(K, More))). |
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
| name: Security audit | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| push: | |
| paths: | |
| - '**/Cargo.toml' | |
| - '**/Cargo.lock' | |
| jobs: | |
| security_audit: |
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
| ;; Copyright 2020 Nicolas Rougier - BSD License | |
| ;; Usage: emacs -q -l bordered.el | |
| (set-face-font 'default "Roboto Mono Light 14") | |
| (setq default-frame-alist | |
| (append (list '(width . 72) '(height . 40) | |
| '(vertical-scroll-bars . nil) | |
| '(internal-border-width . 0) | |
| '(font . "Roboto Mono Light 14")))) | |
| (set-frame-parameter (selected-frame) | |
| 'internal-border-width 0) |
I think I’ve figured out most parts of the cubical type theory papers; I’m going to take a shot to explain it informally in the format of Q&As. I prefer using syntax or terminologies that fit better rather than the more standard ones.
Q: What is cubical type theory?
A: It’s a type theory giving homotopy type theory its computational meaning.
Q: What is homotopy type theory then?
A: It’s traditional type theory (which refers to Martin-Löf type theory in this Q&A) augmented with higher inductive types and the univalence axiom.
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
| -- Note: There is a more complete explanation at https://github.com/hwayne/lets-prove-leftpad/tree/master/idris | |
| import Data.Vect | |
| -- `minus` is saturating subtraction, so this works like we want it to | |
| eq_max : (n, k : Nat) -> maximum k n = plus (n `minus` k) k | |
| eq_max n Z = rewrite minusZeroRight n in rewrite plusZeroRightNeutral n in Refl | |
| eq_max Z (S _) = Refl | |
| eq_max (S n) (S k) = rewrite sym $ plusSuccRightSucc (n `minus` k) k in rewrite eq_max n k in Refl | |
| -- The type here says "the result is" padded to (maximum k n), and is padding plus the original |
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
| a4b.amazonaws.com | |
| access-analyzer.amazonaws.com | |
| account.amazonaws.com | |
| acm-pca.amazonaws.com | |
| acm.amazonaws.com | |
| airflow-env.amazonaws.com | |
| airflow.amazonaws.com | |
| alexa-appkit.amazon.com | |
| alexa-connectedhome.amazon.com | |
| amazonmq.amazonaws.com |
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
| : -range ( a-addr1 u -- a-addr2 a-addr1 ) | |
| cells over + ; | |
| : range ( a-addr1 u -- a-addr1 a-addr2) | |
| -range swap ; | |
| : map! ( xt a-addr u -- ) | |
| range ?do i @ over execute i ! cell +loop ; | |
| : foldl ( xt w1 a-addr u2 -- w2 ) |