Skip to content

Instantly share code, notes, and snippets.

View howell's full-sized avatar

Sam Caldwell howell

  • Northeastern University
View GitHub Profile
#lang syndicate
(require racket/set
racket/list)
(require/activate syndicate/drivers/timestate)
#|
Goal: researchers organize themselves into conversations based on mutual interests
#lang turnstile
(define-base-type Int)
(define-type-constructor → #:arity >= 1
#:arg-variances (λ (stx)
(syntax-parse stx
[(_ τ_in ... τ_out)
(append
(stx-map (λ _ contravariant) #'[τ_in ...])
(list covariant))])))
#lang racket
(require (for-syntax racket/syntax)
(for-syntax racket/base)
(for-syntax racket/match))
(begin-for-syntax
(define (aux pat-stx trie-exp outer-stx)
(match-define (list temp1 temp2) (generate-temporaries #'(tmp1 tmp2)))
(datum->syntax
module Kata where
import Data.Char (isLower, toUpper)
kata :: String -> String
kata = unwords . reverse . fst . foldl helper ([], False) . words
where
helper (xs, True) word = (word : xs, True)
helper (xs, False) word@(w:ws)
| isLower w = ((toUpper w : ws) : xs, True)
enum test_enum {
one = 1,
two = 2
};
struct test_struct {
enum test_enum e;
u32 foo;
u8 baz[4];
Excerpt from Le Ton beau de Marot by Douglas Hofstadter:
Cloaked in "You Guys", Old "Man" Resurfaces in New Guise
In my view, the most pervasive -- and, for that reason, by far the most
serious -- disease of sexist usage infecting contemporary American English is
the to-many-people-innocuous-sounding phrase "you guys" (and related ways of
using "guys" in directly addressing a group of people), which is by far more
popular than the now-taboo sexist terms "man/men" ever were, in terms of
applicability to a mixed-sex or even all-female group. I find it an amazing
import Data.List (intercalate)
n `divides` x = x `mod` n == 0
crackle x
| 3 `divides` x = "Crackle"
| otherwise = ""
pop x
| 5 `divides` x = "Pop"