Idris termination detection on values to be structurally smaller when calling function recursively. For example in this case the compiler understands that xs
is smaller than x :: xs
:
foo : List a -> ()
foo (x :: xs) = foo xs
foo [] = ()
//! Sample `lazy_static` function which provides an utility | |
//! similar to [lazy_static crate](https://github.com/rust-lang-nursery/lazy-static.rs) | |
//! but without any macros. | |
#![feature(alloc_static)] | |
use std::ptr; | |
use std::collections::HashMap; | |
use std::sync::atomic::*; |
//! A simple utility to count the number of allocated objects per type: | |
//! declared a field of type `ObjectCounter<T>` inside your type `T`, | |
//! and then `ObjectCounter::<T>::count()` will return the number of | |
//! allocated objects. | |
//! | |
//! This could be used for example a quick and dirty way to count | |
//! domain-specific objects e. g. sockets, connections, buffers, | |
//! requests etc. | |
#![feature(alloc_static)] |
(lldb) bt all | |
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0 | |
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0 | |
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0 | |
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0 | |
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0 | |
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0 | |
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0 | |
error: need to add support for DW_TAG_base_type '()' encoded with DW_ATE = 0x7, bit_size = 0 | |
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP |
#![feature(test)] | |
extern crate test; | |
use std::fs::File; | |
use std::io::{BufReader, BufRead}; | |
#[bench] | |
fn scan_for_generated(bencher: &mut test::Bencher) { | |
let mut large_file = String::new(); |
I recall a dream from childhood | |
Wave of magic delight (it is actually some gibberish) | |
Ded Moroz (Russian version of Santa Claus) will come to me | |
And will bring his bag | |
Childhood went into fog | |
Youth went far away | |
But at Chistmas night | |
I see the tale again and again |
Obsidian is a gem.
It is the app I always wanted.
Evernote was great, but it degraded over time: they had a nice and fast note-taking app and added hundreds of functions I don't need. It became slow and the interface became overloaded in the last version I used many years ago.
#[tokio::main] | |
async fn main() { | |
let futs = (0..1000).map(|i| tokio::task::spawn(async move { i })); | |
for fut in futs { | |
# remove unconstraint, and it will block | |
let i = futures::executor::block_on(tokio::task::unconstrained(fut)).unwrap(); | |
eprintln!("{}", i); | |
} | |
} |
use std::collections::HashMap; | |
use std::ops::Deref; | |
use std::ops::DerefMut; | |
use bevy::app::App; | |
use bevy::ecs::schedule::InternedScheduleLabel; | |
use bevy::ecs::schedule::ScheduleLabel; | |
use bevy::prelude::{IntoSystem, IntoSystemConfigs}; | |
use crate::bevy_util::auto_deps::res::{read_in_system, write_out_system}; |
use std::hint; | |
use bevy::prelude::*; | |
#[derive(Component, Copy, Clone)] | |
struct Transform(Mat4); | |
#[derive(Component, Copy, Clone)] | |
struct Position(Vec3); | |
#[derive(Component, Copy, Clone)] |