duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
| DROP DATABASE IF EXISTS animalsdb; | |
| CREATE DATABASE animalsdb; | |
| \c animalsdb; | |
| -- We're modeling the following Haskell datatype: | |
| -- | |
| -- data Animal = Cat Name Age | Dog Name OwnerId | |
| -- | |
| -- We're going to factor the common 'Name' field into the animal table. |
| instance YesodPersist App where | |
| type YesodPersistBackend App = SqlBackend | |
| runDB action = do | |
| master <- getYesod | |
| runSqlPool (hackTheReader action) $ appConnPool master | |
| newtype BenchmarkResults = BenchmarkResults [(Text,TimeSpec)] | |
| deriving Typeable | |
| type TypeMap = HashMap TypeRep Dynamic |
Everything was moved to https://github.com/rabbitonweb/papers_i_love
| # Since a key-value store is a finite, discrete function, and functions | |
| # can be composed, then Hashes can be composed. | |
| # | |
| # The syntactic sugar for calling lambdas, accessing array values, and | |
| # other objects which have a #[] method allow composition of Hashes | |
| # with all sorts of objects and contexts with the same implementation. | |
| # | |
| # Play with it at https://eval.in/388458 | |
| # | |
| class Hash |
| {-# LANGUAGE DeriveFunctor #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {- | |
| Explores Free Monads (DSLs) and Cofree Comonads (interpreters) and | |
| their relationship. | |
| Most of the code in this file comes from (1) below. Only minor | |
| modifications are made - semantics are preserved. |
| -- Working through the Yorgey lectures on Applicatives for Haskell and trying to work out the homework... | |
| -- A parser for a value of type a is a function which takes a String | |
| -- represnting the input to be parsed, and succeeds or fails; if it | |
| -- succeeds, it returns the parsed value along with the remainder of | |
| -- the input. | |
| newtype Parser a = Parser { runParser :: String -> Maybe (a, String) } | |
| -- For example, 'satisfy' takes a predicate on Char, and constructs a | |
| -- parser which succeeds only if it sees a Char that satisfies the |