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 FlexibleInstances #-} | |
{-# language DefaultSignatures #-} | |
{-# language RankNTypes #-} | |
{-# language MultiParamTypeClasses #-} | |
{-# language QuantifiedConstraints #-} | |
module Data.Group.Graded where | |
import Data.Functor.WithIndex | |
import Data.Group | |
import Data.Map (Map) |
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
http://codeforces.com/problemset/problem/628/F | |
http://codeforces.com/gym/100729 : Problem F | |
http://codeforces.com/gym/100517 : Problem H | |
http://codeforces.com/gym/101128 : Problem F | |
http://codeforces.com/gym/100491 : Problem A | |
http://codeforces.com/gym/101175 : Problem D (WF) | |
http://codeforces.com/gym/101221 : Problem I (WF) | |
http://codeforces.com/gym/100800 : Problem A | |
http://codeforces.com/gym/101239 : Problem C (WF) | |
http://codeforces.com/gym/101208 : Problem C (WF) |
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
[11:48 PM] Goose: OK I finished the epilogue | |
[11:54 PM] cantordust: Mm, right, so now it's time to read the webpage | |
[11:54 PM] cantordust: https://www.gregegan.net/DICHRONAUTS/DICHRONAUTS.html | |
Dichronauts — Greg Egan | |
Illustrations for Dichronauts by Greg Egan | |
[11:54 PM] Goose: I am reading the webpage already. :stuck_out_tongue: | |
[11:54 PM] cantordust: There's basically an entire treatise :stuck_out_tongue: | |
[11:54 PM] Goose: I am going through it right now. | |
[11:54 PM] cantordust: man nice, he has the same thing for incandescence which is about SR/GR | |
[11:54 PM] cantordust: https://www.gregegan.net/INCANDESCENCE/Incandescence.html#CONTENTS |
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
#include <assert.h> | |
#include <iostream> | |
#include <limits> | |
using namespace std; | |
#define INT32_TAG 0xfffffffe | |
// https://github.com/WebKit/webkit/blob/950143da027e80924b4bb86defa8a3f21fd3fb1e/Source/JavaScriptCore/runtime/JSCJSValueInlines.h | |
// https://github.com/WebKit/webkit/blob/950143da027e80924b4bb86defa8a3f21fd3fb1e/Source/JavaScriptCore/runtime/JSCJSValue.h | |
// https://en.wikipedia.org/wiki/NaN | |
union PunDouble { | |
double d; |
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 NoImplicitPrelude #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
-- | to define <*> in terms of monad. | |
import Control.Monad (ap) | |
import Control.Category | |
import GHC.Types (Int, Float) | |
import GHC.Float | |
import GHC.Real hiding (fromIntegral, floor, Real) | |
import qualified GHC.Real | |
import GHC.Num |
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 NoImplicitPrelude #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
-- | to define <*> in terms of monad. | |
import Control.Monad (ap) | |
import Control.Category | |
import GHC.Types (Int, Float) | |
import GHC.Float | |
import GHC.Real hiding (fromIntegral, floor, Real) | |
import qualified GHC.Real | |
import GHC.Num |
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 NoImplicitPrelude #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
-- | to define <*> in terms of monad. | |
import Control.Monad (ap) | |
import Control.Category | |
import GHC.Types (Int, Float) | |
import GHC.Float | |
import GHC.Real hiding (fromIntegral, floor, Real) | |
import qualified GHC.Real | |
import GHC.Num |
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 itertools | |
# check all pairs (a, c in R | b, d in S): | |
# (a/b) ~ (c/d) | |
# check exists e in S: (ad - bc)e = 0 | |
R = IntegerModRing(10) | |
S = [] | |
s0 = R(6) | |
for i in range(0, 10000): |
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 RecursiveDo #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
import Control.Monad | |
import Control.Monad.Fix | |
data T fix f bix b a = T { runt :: (fix -> f, bix -> b) -> (a, fix -> f, bix -> b) } deriving(Functor) | |
instance Applicative (T fix f bix b) where pure = return; (<*>) = ap | |
instance Monad (T fix f bix b) where | |
return x = T $ \ ~(f, b) -> (x, f, b) | |
tx >>= x2ty = T $ \ ~(f, b) -> |
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 python3 | |
# The Category of M-sets | |
# M. Mehdi Ebrahimi and M. Mahmoudi | |
# Department of Mathematics | |
# Shahid Beheshti University | |
# Tehran 19839, Iran | |
class FinSet(set): | |
def __init__(self, s = ()): | |
set.__init__(self, s) |