View ModArith.hs
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 RankNTypes #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
module ModArith | |
( WithMod | |
, IntMod | |
, doMod | |
) where | |
import Control.Applicative (liftA2) |
View aio2021q5.hs
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
import Control.Monad.Tardis | |
import Data.Function (on) | |
import Control.Monad (replicateM, zipWithM, liftM, ap) | |
import Data.Foldable (toList) | |
import System.IO (openFile, IOMode(ReadMode), hGetLine) | |
import Control.Monad.Fix (MonadFix(..)) | |
import Control.Monad.Trans (MonadTrans(..)) | |
import Data.Functor.Identity (Identity(runIdentity)) | |
import Data.List (uncons) |
View primechess.hs
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 DataKinds #-} | |
import Prelude hiding (iterate) | |
import Control.Monad.State (StateT, execStateT, get, gets, modify) | |
import Control.Arrow ((>>>)) | |
import Data.Functor.Compose (Compose(Compose)) | |
import Data.List (sort, nub) | |
import Control.Monad (when, guard) | |
import Control.Monad.Trans (lift) |
View FixedList.hs
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 TypeOperators #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE NoStarIsType #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} |
View test.tex
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
\documentclass[a4paper]{article} | |
\def \error{\def\error1{}\error2} | |
\def \S#1#2#3{#1#3{#2#3}} | |
\def \K#1#2{#1} | |
\def \i#1{#1\S\K} | |
\begin{document} | |
\i{\i{\i\i}}1\error % Does not error |
View main.hs
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 DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
import Data.Type.Set (AsSet) | |
class GoodType t | |
data Type1 |
View printByte.iota
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
ι(ι(ι(ιι)))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ιι)(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))))))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))))))))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))))))))))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ιι))))))))))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))))))))))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ιι))))))))))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))))))))))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ιι))))))))))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))))))))))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι))(ι(ι(ι(ιι)))(ι(ι(ιι) |
View Functions.hs
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 TemplateHaskell #-} | |
module Functions where | |
import FunctionsTemplate (generateFunctions) | |
generateFunctions |
View magic.hs
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
-- Normal if statement, requires brackets or associative operators for nesting. | |
if' :: Bool -> a -> a -> a | |
if' b x y = if b then x else y | |
{- | |
Magic if statement, no brackets needed. | |
`magicIf` and `magicElseIf` pass on a function, that is either `id` or | |
`const x` saying what to do when a True or Else case is reached, to the next | |
`magicElseIf` or `magicElse`. | |
-} |
View 2Stamp.hs
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
import qualified DP | |
import Data.Map ((!)) | |
nextSubproblem :: DP.DPCalc Int Int () Int | |
nextSubproblem = do | |
this <- DP.thisSubproblem | |
return (this + 1) | |
subproblemSolver :: DP.DPCalc Int Int () Int | |
subproblemSolver = do |
NewerOlder