Skip to content

Instantly share code, notes, and snippets.

@EmmanuelOga
Created November 26, 2015 00:05
Show Gist options
  • Select an option

  • Save EmmanuelOga/9c23b5ee4ff9145fdc35 to your computer and use it in GitHub Desktop.

Select an option

Save EmmanuelOga/9c23b5ee4ff9145fdc35 to your computer and use it in GitHub Desktop.
Desugaring sequencing (begin ...) over lambdas.
#lang racket
; Desugaring sequencing (begin ...) over lambdas.
(define (h _) (print "hello"))
(define (w _) (print "world"))
(define (seq x)
(λ (y)
(y (x null))))
(define (hw _) ((seq h) w))
((seq hw) hw) ; "hello""world""hello""world"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment