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
{-# 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 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
// 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 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
// 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 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
// 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 has been truncated, but you can view the full file.
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
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 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
Module { | |
types: { | |
[1]: Type { | |
name: None, | |
inner: Scalar { | |
kind: Float, | |
width: 4, | |
}, | |
}, | |
[2]: Type { |
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
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 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
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 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
Shader "Unlit/AudioLinkUI" | |
{ | |
Properties | |
{ | |
} | |
SubShader | |
{ | |
Pass | |
{ | |
CGPROGRAM |
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
Shader "Unlit/Shadowed" | |
{ | |
SubShader | |
{ | |
Pass | |
{ | |
Tags { "LightMode"="Always" } | |
CGPROGRAM | |
#pragma vertex vert | |
#pragma fragment frag |