/graph-contracts.rkt Secret
Created
July 3, 2019 09:13
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
#lang racket | |
;; TODO: represent bases in binary | |
(struct node* (sequence offset)) | |
(provide | |
(contract-out [struct node* ((sequence string?) (offset (or/c natural? null)))])) | |
(provide (contract-out | |
[node (-> string? | |
(or/c natural? null?) | |
(struct/c node* string? (or/c natural? null?)))])) | |
;; define node as a fn | |
(define/contract (node sequence [offset null]) | |
(node* sequence offset)) | |
(node* 123 "dd") ;; succeeds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
alternative using typed/racket
Or if you want to use null: