Skip to content

Instantly share code, notes, and snippets.

View soareschen's full-sized avatar
🏠
Working from home

Soares Chen soareschen

🏠
Working from home
View GitHub Profile
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHVMj2JxwEJc8zpHLSD3T1memwQ/tkCJk5Rf2zseCvpv soares@soares-desktop
@soareschen
soareschen / cgp-cake.rs
Created December 25, 2024 20:17
Scala Cake in CGP
// This is an example of how the Scala cake pattern can be used in CGP,
// following the example at https://www.baeldung.com/scala/cake-pattern
pub mod traits {
use std::collections::BTreeMap;
use anyhow::Error;
use cgp::prelude::*;
// For simplicity of the example, we use `dyn` trait to represent test cases