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
#lang racket | |
(require (for-syntax racket/syntax | |
threading) | |
racket/contract | |
syntax/parse/define) | |
(define/contract (make-singleton name) | |
(-> symbol? any/c) | |
(struct singleton () |
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
#lang racket | |
(require (for-syntax racket/syntax) | |
syntax/parse/define | |
syntax/stx) | |
(begin-for-syntax | |
(define-syntax-class a/d*r | |
#:attributes [[a/d 1]] | |
#:description "a sequence of ‘a’s and ‘d’s followed by a single ‘r’" |
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
#lang racket | |
(require (for-syntax racket/function | |
syntax/apply-transformer) | |
syntax/parse/define) | |
(define-syntax ($expand stx) | |
(raise-syntax-error #f "illegal outside an ‘expand-inside’ form" stx)) | |
(begin-for-syntax |
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
#lang racket/base | |
(require (for-meta 2 racket/base | |
syntax/parse) | |
(for-syntax racket/base | |
racket/list | |
racket/trace | |
syntax/kerncase | |
threading) | |
racket/sequence |
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
#lang racket/base | |
(require (for-syntax (only-in hackett/private/util/stx | |
syntax/loc/props quasisyntax/loc/props) | |
racket/base | |
racket/list | |
threading) | |
syntax/parse/define) | |
(provide expand-expression) |
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
#lang racket | |
(require (for-syntax syntax/kerncase) | |
syntax/parse/define) | |
(define-simple-macro (m1 e:expr) | |
#:with x (local-expand #'e 'expression (kernel-form-identifier-list)) | |
(quote-syntax x)) | |
(define-simple-macro (m1.1 e:expr) |
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
#lang racket | |
(require (for-syntax syntax/kerncase | |
syntax/transformer) | |
syntax/parse/define) | |
(begin-for-syntax | |
(struct type:con (id) #:prefab) | |
(struct type:app (a b) #:prefab) | |
(struct type:forall (x t) #:prefab) |
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
#lang racket | |
(require (for-syntax (for-syntax (only-in racket/private/sc | |
[syntax-mapping-depth syntax-pattern-variable-depth] | |
[syntax-mapping-valvar syntax-pattern-variable-value])) | |
(rename-in racket [quote-syntax quote-syntax/no-introduce]) | |
syntax/parse/define) | |
syntax/parse/define) | |
(begin-for-syntax |
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
class Monad m => FileSystemMonad m where | |
listDirectory' :: String -> m [String] | |
readFile' :: String -> m String | |
writeFile' :: String -> String -> m () | |
instance FileSystemMonad IO where | |
listDirectory' = listDirectory | |
readFile' = readFile | |
writeFile' = writeFile |