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
| #!/usr/bin/env runghc | |
| {-# LANGUAGE GHC2024 #-} | |
| {-# OPTIONS_GHC -Wall #-} | |
| import Control.Applicative (optional, (<|>)) | |
| import Data.List (intercalate) | |
| import Data.Maybe (catMaybes) | |
| import Prelude hiding (Either (..)) |
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
| #!/usr/bin/env runghc | |
| {-# LANGUAGE BlockArguments #-} | |
| {-# LANGUAGE GHC2024 #-} | |
| {-# OPTIONS_GHC -Wall #-} | |
| {-# OPTIONS_GHC -Wno-name-shadowing #-} | |
| module Main (main) where |
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
| class SomeDictNC n k c | n -> k, c -> k where | |
| data SomeDictN n k c :: Type | |
| instance k ~ Constraint => SomeDictNC 0 k c where | |
| data SomeDictN 0 k c where | |
| SomeDict0 :: c => SomeDictN 0 k c | |
| instance (k ~ (k1 -> Constraint), SomeDictNC 1 k c) => SomeDictNC 1 k c where | |
| data SomeDictN 1 k c where | |
| SomeDict1 :: c a => Proxy a -> SomeDictN 1 k c |
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
| type Rebuilder c i k v = k -> v -> Task c k v -> Task (MonadState i) k v | |
| type Scheduler c i j k v = Rebuilder c j k v -> Build c i k v | |
| type Build c i k v = Tasks c k v -> k -> Store i k v -> Store i k v | |
| data Store i k v = Store { info :: i, values :: k -> v } | |
| type Tasks c k v = k -> Maybe (Task c k v) |
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
| macro_rules! defer { | |
| ($f:expr) => { | |
| let __defer = { | |
| struct Defer<F: FnMut()>(F); | |
| impl<F: FnMut()> Drop for Defer<F> { | |
| fn drop(&mut self) { | |
| (self.0)(); | |
| } | |
| } | |
| Defer($f) |
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 DerivingStrategies #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE LambdaCase #-} | |
| {-# LANGUAGE PatternSynonyms #-} | |
| {-# OPTIONS_GHC -Wall #-} | |
| module Checkpoint | |
| ( FreshT (..) | |
| , runFreshT |
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
| // defining the plugin: | |
| use bevy::{prelude::*, tasks::IoTaskPool}; | |
| pub struct Parker(parking::Parker); | |
| #[derive(Resource)] | |
| pub struct Unparker(pub parking::Unparker); | |
| fn park_system(parker: NonSend<Parker>) { |
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
| use crop::Rope; | |
| #[must_use] | |
| pub fn prev_grapheme_boundary(rope: &Rope, mut byte_offset: usize) -> Option<usize> { | |
| if byte_offset == 0 { | |
| return None; | |
| } | |
| byte_offset -= 1; | |
| while !rope.is_grapheme_boundary(byte_offset) { | |
| byte_offset -= 1; |
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
| #!/usr/bin/env bash | |
| set -Eeuo pipefail | |
| IFS=$'\n\t' | |
| # https://github.com/evanrelf/indigo/tree/rust4 | |
| core=$(gum style --border normal "$(fd . --extension rs crates/core/src/ | as-tree --color always)") | |
| tui=$(gum style --border normal "$(fd . --extension rs crates/tui/src/ | as-tree --color always)") | |
| btree=$(gum style --border normal "$(fd . --extension rs crates/btree/src/ | as-tree --color always)") |
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
| #!/usr/bin/env runghc | |
| -- ki, unfork, stm | |
| {-# LANGUAGE BlockArguments #-} | |
| {-# OPTIONS_GHC -Wall #-} | |
| {-# OPTIONS_GHC -threaded #-} | |
| import Control.Concurrent qualified as Concurrent |
NewerOlder