- MacLane P.8の下から2つ目のパラグラフの記述。なぜIdentityが一意に決まるのか?証明できる?
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
;; .emacs | |
;; for Haskell | |
(add-hook 'haskell-mode-hook 'haskell-indentation-mode) | |
;;; uncomment this line to disable loading of "default.el" at startup | |
;; (setq inhibit-default-init t) | |
;; enable visual feedback on selections | |
;(setq transient-mark-mode 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
module AgdaBasics where | |
data Bool : Set where | |
true : Bool | |
false : Bool | |
not : Bool → Bool | |
not true = false | |
not false = true |
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
module Views where | |
open import Data.Nat renaming (ℕ to Nat) | |
--open import AgdaBasics | |
data Parity : Nat → Set where | |
even : (k : Nat) → Parity (k * 2) | |
odd : (k : Nat) → Parity (1 + k * 2) | |
-- zero + m = m |
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
import Data.Char | |
import System.IO | |
import System.Random | |
import System.Environment | |
numListToString :: [Int] -> String | |
numListToString [] = [] | |
numListToString (x:xs) = (show x) ++ "\n" ++ numListToString xs | |
main = do |
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
#include <bits/stdc++.h> | |
using namespace std; | |
void f(vector<int> *p) | |
{ | |
vector<int>::iterator it = p->begin(); | |
int i = 0; | |
int max = 0; | |
while (i < p->size()) |
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
#include <bits/stdc++.h> | |
using namespace std; | |
void f(vector<int> *v) | |
{ | |
vector<int>::iterator vit, vit_end; | |
vector<int>::iterator vit2, vit2_end; | |
vit = v->begin(); | |
int i = 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
#include <bits/stdc++.h> | |
using namespace std; | |
#include <stdio.h> | |
#include <sys/time.h> | |
#include <sys/resource.h> | |
#include <sys/types.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#define MAX_STRING 128 |
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
module Universes where | |
data False : Set where | |
record True : Set where | |
data Bool : Set where | |
true : Bool | |
false : Bool | |
isTrue : Bool -> Set |
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
makeBitString :: Int -> [String] | |
makeBitString 0 = [] | |
makeBitString 1 = ["0","1"] | |
makeBitString w = map ('0':) (makeBitString (w-1)) ++ map ('1':) (makeBitString (w-1)) | |
makeMaskZeroString :: Int -> [String] | |
makeMaskZeroString w = ((map oneToMask) . makeBitString) w | |
where | |
oneToMask :: String -> String | |
oneToMask = (map (\c -> if c == '1' then '*' else c)) |
OlderNewer