We will be comparing the following DB libraries:
- HRR
- Opaleye
- Persistent + Esqueleto
- Groundhog
- postgresql-simple (and postgresql-transactional)
#!/usr/bin/env stack | |
-- stack --resolver=nightly-2015-07-08 runghc --package=shelly | |
-- The ExtendedDefaultRules extension gives us an experience similar to | |
-- @ghci@. Raw values (1 and 10 below) that implement the 'Num' type | |
-- class will be defaulted to 'Int' (specified with the @default@ | |
-- command below). Raw values (all strings) that implement the | |
-- 'IsString' typeclass will be defaulted to Text (also specified | |
-- with the @default@ command below). | |
-- |
dist | |
cabal-dev | |
*.o | |
*.hi | |
*.chi | |
*.chs.h | |
*.dyn_o | |
*.dyn_hi | |
.hpc | |
.hsenv |
{-# LANGUAGE ScopedTypeVariables #-} | |
-- | This is an explanation of a combination function written in Haskell | |
-- from http://rosettacode.org/wiki/Combinations#Dynamic_Programming_2 | |
module Main where | |
-- | Adds a @a@ to the beginning of every list inside the list of lists. | |
-- However, if the list of lists is just an empty list, return an empty | |
-- list. |
{-# LANGUAGE Rank2Types #-} | |
-- This is a small example of where you need to use Rank2Types (or | |
-- RankNTypes). | |
-- The 'a' type is being used polymorphically here, but when it | |
-- is called, it will already be bound (as either an Int or String), | |
-- so it cannot be used polymorphically. | |
-- |
#!/usr/bin/env runhaskell -Wall | |
import Control.Concurrent (threadDelay, forkIO) | |
import Control.Concurrent.MVar | |
import Control.Monad (liftM, filterM) | |
import Data.List (isPrefixOf, (\\)) | |
import HSH.ShellEquivs (glob) | |
import System.Directory (canonicalizePath, getCurrentDirectory, doesFileExist) | |
--import System.Environment (getArgs) | |
import System.FilePath ((</>)) |