Skip to content

Instantly share code, notes, and snippets.

View VictorTaelin's full-sized avatar

Victor Taelin VictorTaelin

View GitHub Profile
You're a code completion assistant.
###
-- Checker:
--
module Kind.Type where
import qualified Data.IntMap.Strict as IM
import qualified Data.Map.Strict as M
import Debug.Trace
@VictorTaelin
VictorTaelin / wtf_new_sonnet.txt
Created October 23, 2024 14:41
wtf new sonnet
You're a code completion assistant.
###
-- Type.hs:
--
module Kind.Type where
import qualified Data.IntMap.Strict as IM
import qualified Data.Map.Strict as M
@VictorTaelin
VictorTaelin / new_sonnet_bad.txt.hs
Last active October 22, 2024 21:33
new sonnet bad?
You're a code completion assistant.
###
--
module Kind.Type where
import qualified Data.IntMap.Strict as IM
import qualified Data.Map.Strict as M
import Debug.Trace
import Data.Word (Word32)
@VictorTaelin
VictorTaelin / getters_setters_kind_lang.md
Created October 19, 2024 17:37
Getters and Setters in Kind-Lang

Getters and Setters in Kind

The verbosity of nested fields

One of the most annoying aspects of pure functional programming is getting, setting and mutating deeply nested fields. In impure languages like JavaScript, this was never a problem. For example, consider the following object:

@VictorTaelin
VictorTaelin / aff.txt
Last active October 17, 2024 23:19
aff
from: https://discord.com/channels/767397347218423858/767397347218423861/1296580936292499540
Taelin — Today at 5:41 PM
@AndrasKovacs i see you often treat lambda-case and case-of with different constructors. why? is there any obvious cons to just treating (λ{ ... } arg) as a case-of?
Taelin — Today at 6:09 PM
actually, also, consider this:
Main
: ∀(P: ∀(x: B/Bool) *) →
I: 1 5 9 3 0 0 A 8 1 E D F 6 5 4 8
O: 1 1 0 6 9 D A 4 5 E 0 5 3 F 8 8
I: 3 0 E C 6 1 F B 3 B 4 F 7 3 E 1
O: 3 3 6 7 E 4 F E 0 B 1 3 C F B 1
I: 8 4 7 C 1 8 7 1 F 0 1 B 9 8 7 6
O: 8 F 1 9 7 1 7 7 4 0 8 8 C B 1 6
I: 3 2 9 D A 2 C 2 D 3 F D 7 F B 6
@VictorTaelin
VictorTaelin / ai_reasoning_challenge_v2.md
Last active June 15, 2025 00:20
INVERT A BINARY TREE - $10k AI REASONING CHALLENGE (v2)

THE PROBLEM

🌲 Invert a binary tree! 🌲

Except with 3 catches:

  1. It must invert the keys ("bit-reversal permutation")
  2. It must be a dependency-free, pure recursive function
  3. It must have type Bit -> Tree -> Tree (i.e., a direct recursion with max 1 bit state)
@VictorTaelin
VictorTaelin / ab_reasoning_eval.txt
Created September 14, 2024 03:19
A::B System - Reasoning Eval - prompt
Let an AB symbol be one of 4 possible variants:
data AB : Set where
A# : AB
#A : AB
B# : AB
#B : AB
Let an AB Term be a list of AB symbols:
@VictorTaelin
VictorTaelin / mod_exp_enum_rotation.hvm1.c
Last active September 10, 2024 16:48
Mod Exp via Enum Rotations
// Computes modular exponentiation by repeated ENUM rotation.
//
// To compute `a ^ b % M`, we:
// - 1. Create a generic ENUM with M variants: enum T { v0, v1, v2, ... vM }
// - 2. Create a generic ENUM rotator: v0 -> v1, v1 -> v2, ... v1 -> v0
// - 3. Apply that rotator a^b times to v0; the result will be `a ^ b % M`!
//
// To test this, we compute `(123 ^ 10) % 257`.
// This should require at least 792594609605189126649 function calls.
// A Macbook M3 would take about 25,000 years to *count* to that number.
@VictorTaelin
VictorTaelin / ic_hoas_bug_complete_log.hvm1
Created September 3, 2024 11:43
IC HOAS BUG - COMPLETE LOG
<0>(HVM_MAIN_CALL)
----------------
<0>(HVM_MAIN_CALL)
----------------
<0>(Main)
----------------
<0>(Main)
----------------
<0>(Quote (APP (C2a) (C2b)) 0)
----------------