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
---- Minecraft Crash Report ---- | |
// Daisy, daisy... | |
Time: 8/15/20 12:52 PM | |
Description: Unexpected error | |
java.lang.NullPointerException: Registry Object not present: mahoutsukai:murky_flow | |
at java.util.Objects.requireNonNull(Unknown Source) ~[?:1.8.0_171] {} | |
at net.minecraftforge.fml.RegistryObject.get(RegistryObject.java:120) ~[?:?] {re:classloading} | |
at stepsword.mahoutsukai.util.Utils.isInMurkyWater(Utils.java:158) ~[?:1.15.2-v1.21.6] {re:classloading} |
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
#!/bin/bash | |
# Convenient when you're using lots of in-browser terminals. | |
set -eu | |
MAXLEN=74994 | |
TARGET=$1 | |
if [ -f $TARGET ]; then |
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
stack exec --no-ghc-package-path --resolver ghc-8.4.3 --package cabal-install zsh |
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
{-# Language DeriveFunctor, FlexibleInstances #-} | |
module Lib where | |
newtype Mu f = Mu (f (Mu f)) | |
data ArithF f = | |
ALit Int | | |
AAdd f f | | |
ASub f f deriving Functor |
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
#!/usr/bin/env stack | |
-- stack --resolver lts-10.8 --install-ghc exec ghci | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE LambdaCase #-} | |
-- A key type for pretend use in looking up a doggo in a database. | |
newtype Key a = Key { unKey :: String } |
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
data SomeThing = SomeThing { name :: Text, age :: Int } | |
makeSomeThing :: (Monad m) => m Text -> m Int -> m SomeThing | |
makeSomeThing nameE ageE = do | |
name <- nameE | |
age <- ageE | |
return $ SomeThing name age |
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
package stupid | |
import ( | |
"fmt" | |
"reflect" | |
"unsafe" | |
) | |
type iptr struct { |
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
{-# LANGUAGE TypeFamilies, ScopedTypeVariables, OverloadedStrings, TemplateHaskell, RankNTypes #-} | |
module Main where | |
import Data.Map (Map(..), empty) | |
import Control.Lens | |
import Data.Monoid (mempty) | |
import Data.Text (Text(..)) | |
import Control.Applicative (pure) | |
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
mergeSort :: Ord a => [a] -> [a] | |
mergeSort = hylo alg coalg where | |
alg EmptyF = [] | |
alg (LeafF c) = [c] | |
alg (NodeF l r) = merge l r | |
coalg [] = EmptyF | |
coalg [x] = LeafF x | |
coalg xs = NodeF l r where | |
(l, r) = splitAt (length xs `div` 2) xs |
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
createAndSumTree :: [Int] -> Int | |
createAndSumTree lst = hylo sum build lst where | |
sum (LeafF v) = v | |
sum (NodeF v0 v1) = v0 + v1 | |
build [val] = LeafF val | |
build lst = NodeF l r | |
where (l, r) = splitAt (length lst `div` 2) lst | |
NewerOlder