duplicates = multiple editions
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
A Classical Introduction to Modern Number Theory,Kenneth IrelandMichael Rosen
/** | |
* gets a record out of database by ID | |
* | |
* infers the type to use based on return | |
* | |
* RentalImpl r = Util.getById(10); | |
* | |
* @param c The implementation class name | |
* @param id the id of the instance you want | |
*/ |
def decode(data): | |
""" | |
Accepts a byte array and converts it into an Ack packet if possible. If the | |
decoding fails, then this method raises DecodeError. The following doc test | |
randomly samples legal values for the acknowledgment number and window size and | |
asserts that for all those values, Ack.decode(p.encode()) == p | |
>>> from random import * | |
>>> ack_nos = [randrange(int(1e6)) for i in range(1,10)] | |
>>> win_sizes = [randrange(int(1e3)) for i in range(1,10)] |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE PartialTypeSignatures #-} | |
{-# LANGUAGE NoMonomorphismRestriction #-} | |
module Lensy where | |
import Data.Functor.Identity | |
import Control.Lens | |
data Api f |
{-# LANGUAGE Rank2Types #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
module Mtl where | |
import Control.Monad.State | |
import Control.Monad.Except | |
runMtl | |
:: Bool |
module Jerbs where | |
import Control.Concurrent (forkIO, killThread) | |
import Control.Concurrent.STM (TQueue, atomically, newTQueueIO, | |
readTQueue, writeTQueue) | |
import Control.Exception (SomeException (..), try) | |
import Control.Monad (forever) | |
import Data.Foldable (for_) | |
import Data.Traversable (for) |
Data.MsgPack | |
✗ that galois connection tho: | |
(Right Test.Main.TestVal {bar: 480996, baz: [0.5786002867755481], foo: "뎬�⸨�쭊"}) /= (Right Test.Main.TestVal {bar: 480996, baz: [0.5786002867755481], foo: "뎬�⸨�쭊"}) | |
(Right Test.Main.TestVal {bar: -463187, baz: [0.8810286139515362, 0.7951747639082255], foo: "�"}) /= (Right Test.Main.TestVal {bar: -463187, baz: [0.8810286139515362, 0.7951747639082255], foo: "�"}) | |
(Right Test.Main.TestVal {bar: 431163, baz: [], foo: "뒌閪�襪㎜"}) /= (Right Test.Main.TestVal {bar: 431163, baz: [], foo: "뒌閪�襪㎜"}) | |
(Right Test.Main.TestVal {bar: 431939, baz: [0.3411815847927619, 0.7783211696792027, 0.019137335484445718], foo: "�"}) /= (Right Test.Main.TestVal {bar: 431939, baz: [0.3411815847927619, 0.7783211696792027, 0.019137335484445718], foo: "�"}) | |
(Right Test.Main.TestVal {bar: -683034, baz: [0.09981450722544198, 0.28433427553825746, 0.6274012209043843, 0.41340820370866366, 0.8485718839096705, 0.6971856512581863], foo: "읤�"}) /= (Right Test.Main.TestVal {bar: -683034, baz |
{-# language TypeFamilies, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, DataKinds, TypeOperators, GADTs #-} | |
module TyFam where | |
-- A type family is a function on types. | |
type family Element f | |
type instance Element [a] = a | |
instance MonoFunctor [a] where |
type Join a b = Map (Key a) (Entity a, Collection b) | |
type Collection a = Map (Key a) (Entity a) | |
innerJoin | |
:: ( PersistEntity val1 | |
, PersistEntity val2 | |
, PersistField typ | |
, PersistEntityBackend val1 ~ SqlBackend | |
, PersistEntityBackend val2 ~ SqlBackend |
module Beer where | |
import Data.Char (toUpper) | |
main = putStrLn (song [100, 99 .. 0]) | |
song = unlines . map verse | |
verse x = unlines [firstLine x, secondLine x] |