I hereby claim:
- I am axman6 on github.
- I am axman6 (https://keybase.io/axman6) on keybase.
- I have a public key ASDRJGBz9LCxzTkIG-QeHrvptyisRGUkkQzePU6yy36uugo
To claim this, I am signing this object:
{-# LANGUAGE ConstraintKinds, DataKinds, PolyKinds, TypeFamilies, | |
TypeOperators, RankNTypes, TypeFamilies, UndecidableInstances #-} | |
import GHC.Prim (Constraint) | |
import Control.Exception -- (Exception, SomeException, catch, throw) | |
newtype Throws (es :: [k]) a = Throws (IO a) | |
type family Contains (e :: k) (es :: [k]) :: Constraint where |
{-# LANGUAGE ConstraintKinds, DataKinds, PolyKinds, TypeFamilies, | |
TypeOperators, RankNTypes, TypeFamilies, UndecidableInstances #-} | |
import GHC.Prim (Constraint) | |
import Control.Exception -- (Exception, SomeException, catch, throw) | |
import Control.Monad (ap) | |
type family If (b :: Bool) :: Constraint where |
{-# LANGUAGE ConstraintKinds, TypeFamilies #-} | |
{-# LANGUAGE RebindableSyntax #-} | |
-- {-# LANGUAGE NoImplicitPrelude #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
import Data.Set (Set, unions, toList, singleton) | |
import qualified Data.Set as S | |
import GHC.Prim |
<snippet> | |
<!-- | |
Produces imports of the form: | |
import qualified Data.Foo as F | |
import Data.Foo (Foo, fun) | |
Foo and F in as and includes sections are determined by the last | |
name in the module string: Foo -> F and Foo, Data.Foo -> F and Foo | |
--> |
{-# LANGUAGE BangPatterns #-} | |
import Data.Bits | |
import Data.Word | |
nlz :: Word64 -> Int | |
nlz x = go x x 0 where | |
go !x !y !n | |
| x < 0 = n | |
| y == 0 = 64 - n |
/* Similar to scavenge_large_bitmap(), but we don't write back the | |
* pointers we get back from evacuate(). | |
*/ | |
#define SPARSE_BITS 8 | |
static void | |
scavenge_large_srt_bitmap( StgLargeSRT *large_srt ) | |
{ | |
nat i, j, size; |
fft :: [[Integer]] -> [Integer] -> Integer -> Integer -> Integer -> Integer | |
fft as rho m mM sig pc = ... cooleyTukey bs (rhoMult m mM) (mM `div` mM) ... | |
where Ibs = zipWith (badMult m mM sig pc) pr as | |
pr = powersOfRho (m * 2) rho m mM sig pc | |
data Constants = C { mM :: Integer, sig :: Integer, pc :: Integer} | |
fft :: [[Integer]] -> [Integer] -> Integer -> Integer -> Integer -> Integer | |
fft as rho m mM sig pc = runReader fft' (Constants mM sig pc) |
import Data.Char | |
import Data.Maybe | |
import Data.List | |
import Data.Map hiding (map) | |
import Text.Printf | |
main :: IO () | |
main = do | |
(src :: String) <- readFile "grades.txt" :: IO String | |
let pairs = map (\x -> split (words x)) ((lines src) :: [String]) :: [(String,Int)] |
data BTree a | |
= Null | |
| Leaf a | |
| Node a (BTree a) (BTree a) | |
deriving (Show) | |
-- makeTree :: [a] -> BTree a | |
-- makeTree xs = | |
instance Binary a => Binary (BTree a) where |
I hereby claim:
To claim this, I am signing this object: