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
float3 drawTopArea(float2 uv) | |
{ | |
float3 color = FOREGROUND_COLOR; | |
float areaWidth = 1.0 - FRAME_MARGIN * 2; | |
float areaHeight = 0.35; | |
float boxWidth = areaWidth / 4.0; | |
for (uint i = 0; i < 4; i++) | |
{ |
This file has been truncated, but you can view the full file.
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
Module { | |
types: { | |
[1]: Type { | |
name: None, | |
inner: Scalar { | |
kind: Float, | |
width: 4, | |
}, | |
}, | |
[2]: Type { |
This file has been truncated, but you can view the full file.
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
Module { | |
types: { | |
[1]: Type { | |
name: None, | |
inner: Scalar { | |
kind: Float, | |
width: 4, | |
}, | |
}, | |
[2]: Type { |
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
// Input program | |
sum List 'a = | |
| Cons 'a * List 'a | |
| Nil unit | |
let iota = [n] | |
let inner = rec [inner] [acc] | |
if acc >= n then Nil () | |
else Cons (acc, inner (acc + 1)) |
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
// Hindley-Milner type inference, 2022 Pema Malling | |
// Resources: | |
// - https://course.ccs.neu.edu/cs4410sp19/lec_type-inference_notes.html | |
// - http://dev.stephendiehl.com/fun/006_hindley_milner.html#inference-monad | |
// AST and types | |
type Lit = | |
| Int of int | |
| Bool of bool |
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
// Bidirectional typechecking | |
type Type = | |
| Bool | |
| Fun of Type * Type | |
type Term = | |
| Var of string | |
| App of Term * Term | |
| Lam of string * Term |
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
{-# LANGUAGE FlexibleInstances #-} | |
import Data.Word | |
import Data.Bits | |
import Data.Kind | |
import Graphics.Gloss.Raster.Field | |
import System.Environment | |
import System.Exit | |
import Data.Char | |
-- Random |
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
Shader "Unlit/Double Layer Fresnel" | |
{ | |
Properties {} | |
SubShader { | |
Tags { | |
"RenderType"="Transparent" "Queue"="Transparent" "DisableBatching"="True" "IgnoreProjector" = "True" | |
} | |
GrabPass {} | |
Pass { | |
Name "FORWARD" |
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
Shader "Unlit/ScreenVertPos" | |
{ | |
Properties | |
{ | |
[IntRange] _Width ("Texture Size (POT)", Range(0, 13)) = 7 | |
} | |
SubShader | |
{ | |
Pass | |
{ |
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
module LambdaCalc | |
open Combinator | |
open Common | |
open Util | |
// Lambda calc AST | |
type Expr = | |
| Id of string | |
| Abs of string * Expr |