Skip to content

Instantly share code, notes, and snippets.

@aymanosman
aymanosman / list-elimination.rkt
Last active January 23, 2019 08:25
The Little Typer: Exercises for Chapters 4 and 5
#lang pie
;; Exercises on Pi types and using the List elimiator from Chapters 4 and 5
;; of The Little Typer
;;
;; Some exercises are adapted from assignments at Indiana University
(claim elim-Pair
(Π ((A U)
(D U)
@aymanosman
aymanosman / equality-Nat.rkt
Last active February 21, 2019 20:57
equality-Nat.rkt
#lang pie
;; Exercises on Nat equality from Chapter 8 and 9 of The Little Typer
(claim +
(-> Nat Nat
Nat))
(define +
(λ (n m)
@aymanosman
aymanosman / ind-List.rkt
Last active March 6, 2019 00:52
ind-List.rkt
#lang pie
;; Exercises on ind-Nat from Chapter 10 of The Little Typer
;; Prelude
(claim +
(-> Nat Nat Nat))
(define +
@aymanosman
aymanosman / inequality.rkt
Created March 7, 2019 13:56
inequality.rkt
#lang pie
;; Prelude
(claim +
(-> Nat Nat Nat))
(define +
(lambda (n m)
(rec-Nat n
m
@aymanosman
aymanosman / chapter-15.rkt
Created April 30, 2019 18:08
chapter-15.rkt
#lang pie
(claim =consequence
(-> Nat Nat U))
(define =consequence
(lambda (n m)
(which-Nat n
(which-Nat m
Trivial
@aymanosman
aymanosman / chapter-15-Absurd.rkt
Created April 30, 2019 18:08
chapter-15-Absurd.rkt
#lang pie
;; Exercises on Absurd from Chapter 15 of The Little Typer
(claim +
(-> Nat Nat
Nat))
(define +
(λ (a b)
@aymanosman
aymanosman / codesign.sh
Created January 3, 2020 09:43 — forked from Bogdanp/codesign.sh
Codesigning a Racket executable for inclusion in a macOS app
codesign --force \
--timestamp \
--entitlements="$CODE_SIGN_ENTITLEMENTS" \
--sign="$EXPANDED_CODE_SIGN_IDENTITY_NAME" \
-o runtime \
"${PROJECT_DIR}/Resources/core/lib/Racket.framework/Versions/7.5_3m/Racket"
codesign --force \
--timestamp \
--entitlements="$CODE_SIGN_ENTITLEMENTS" \
@aymanosman
aymanosman / App.nested-stack.js
Created February 10, 2020 11:41
react-navigation-stack ModalPresentationIOS with nested stacks
import * as React from 'react';
import {View, Text, Button} from 'react-native';
import {NavigationNativeContainer} from '@react-navigation/native';
import {createStackNavigator, TransitionPresets} from '@react-navigation/stack';
function HomeScreen({navigation}) {
return (
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<Text>Home Screen</Text>
<Button
@aymanosman
aymanosman / use-cur-example.rkt
Created February 23, 2020 20:50
Example of using Cur
#lang cur
(require cur/ntac/base
cur/ntac/standard
cur/ntac/rewrite
cur/stdlib/sugar
cur/stdlib/nat
cur/stdlib/equality)
((ntac
@aymanosman
aymanosman / show-how-equality-induction-works.rkt
Created March 5, 2020 23:55
There seams to be subtle differences between how the two inductive principles are set up in Coq vs Pie
#lang pie
(claim +
(-> Nat Nat
Nat))
(define +
(λ (a b)
(rec-Nat a
b