Skip to content

Instantly share code, notes, and snippets.

Colette Kerr electroCutie

Block or report user

Report or block electroCutie

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Induction.agda
module plfa.part1.Induction where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong; sym)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _≡⟨_⟩_; _∎)
open import Data.Nat using (ℕ; zero; suc; _+_; _*_; _∸_)
-- left identity: C op n ≡ n
@electroCutie
electroCutie / SevenSegmentSolver.hs
Created Oct 1, 2019
Find magic numbers for a factorio decimal -> 7 segment display decoder
View SevenSegmentSolver.hs
module Main where
import Control.Monad.Random.Lazy
import Data.List (find)
import Data.Maybe
import Debug.Trace
import Text.Printf
primes :: [Integer]
View LoggingUtils.java
package cloud.literallya.util;
import java.util.Map;
import java.util.function.IntSupplier;
import java.util.function.LongSupplier;
import java.util.function.Supplier;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@electroCutie
electroCutie / CompileArguments.hs
Created Jun 5, 2019
Getting the compile line for a spec
View CompileArguments.hs
{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE PatternSynonyms #-}
module Main where
import Text.Printf
import Calibration.CalUnits
View stride.c
#include <stdint.h>
#include <stdio.h>
#include <printf.h>
#define _stride(_type) ({ \
_type* _t = (_type*) 0; \
(uint64_t) (_t+1); \
})
struct st {
@electroCutie
electroCutie / ListConsumer.hs
Last active Sep 7, 2018
A Monad for taking values from a list in a safe way
View ListConsumer.hs
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Data.ListConsumer (
ListConsumer, takeN, peekN, dropN, takeAll, takeAny, runL, runFoldableL
) where
import Control.Applicative
import Control.Arrow
import Control.Monad
View keybase.md

Keybase proof

I hereby claim:

  • I am electrocutie on github.
  • I am electrocutie (https://keybase.io/electrocutie) on keybase.
  • I have a public key ASDKaTj1zKxT1O4hYIKcLIMtpD_dl4AYTbwsNPyE6MgmNgo

To claim this, I am signing this object:

View Eratosthenes.hs
sieve :: [Int]
sieve = 2 : ([3,5..] >>= test sieve)
where
test p c = test' p c $ floor . sqrt . fromIntegral $ c
test' (p:ps) c lim --primes and candiate
| p > lim = [c]
| rem c p == 0 = []
| otherwise = test' ps c lim
You can’t perform that action at this time.