Skip to content

Instantly share code, notes, and snippets.

@mromyers
mromyers / Y.rkt
Created February 17, 2019 17:20
Y combinator and variants
#lang racket/base
;; Y combinator / Normal Order
(define (Yₙ f)(U (comp f U)))
;; Y combinator / Applicative Order
(define (Yₐ f)(U (comp/eta f U)))
;; Polyvaradic Y Combinator / Normal Order
(define (Yₙ* . f*) (U (mcomp f* U)))
;; Polyvaradic Y Combinator / Applicative Order
(define (Yₐ* . f*) (U (mcomp/eta f* U)))
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <search.h>
#define cons(X,Y) new_list((void *) X, Y)
/* Definition of data structures */
typedef struct list{
void *data;
struct list *next;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <search.h>
#include <ctype.h>
#define cons(X,Y) new_list((void *) X, Y)
/* Definition of data structures */
typedef struct list{
void *data;