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
#![allow(unused)] | |
use std::marker::PhantomData; | |
/// Our beloved house | |
#[derive(Debug)] | |
struct House { | |
floors: u32, | |
rooms: u32, | |
has_garage: 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
(** | |
AoC 2022 | |
*) | |
module Day1 = struct | |
let input_file = "./inputs/day1/input.txt" | |
(** Read from a channel till there's no more to read *) | |
let read_all ch = | |
let rec aux acc ch = |
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
use std::cell::RefCell; | |
type UserId = usize; | |
#[derive(Clone, Debug)] | |
struct User(UserId); | |
impl User { | |
fn new(id: UserId) -> Self { | |
Self(id) | |
} |