{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
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
-- | | |
-- Create patterns to divide. | |
-- | |
-- >>> divide 4 | |
-- [[1,1,1,1],[1,1,2],[1,2,1],[1,3],[2,1,1],[2,2],[3,1],[4]] | |
-- | |
divide :: Int -> [[Int]] | |
divide 0 = [[]] | |
divide n = [[x]:y | x <- [1..n], y <- divide (n-x)] |
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
<key> := <startf> <separator>* | |
(<dot> <separator>* <startc> <separator>*)? | |
(<option> <separator>*)* | |
((<comma> <separator>* <endf> <separator>*)? | |
(<dot> <separator>* <endc> <seprator>*)? | |
(<option> <separator>*)* | |
)? | |
<startf> := <num>+ | |
<startc> := <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
module SortKey where | |
import Control.Applicative ( (<$>), (<*>), (<*), (*>) ) | |
import Control.Monad ( void ) | |
import Text.Parsec ( ParsecT, Stream, char, digit, eof, many, many1 | |
, option, runParser, space, (<|>) ) | |
import Text.Parsec.String ( Parser ) | |
data SortKeyAST = SortKeyAST StartF EndF | |
data StartF = SF Int StartC SortOpt |
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 ScopedTypeVariables #-} | |
module Database.Test.PostgreSQL | |
( | |
connect | |
, defineTable | |
) where | |
import Language.Haskell.TH (Dec, Q) | |
import Language.Haskell.TH.Name.CamelCase (ConName) |
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 FlexibleContexts #-} | |
{-# LANGUAGE MonadComprehensions #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Database.Test.Query where | |
import Data.Int (Int32) | |
import Data.Time (Day, UTCTime(utctDay), getCurrentTime) | |
import Database.HDBC.Record.Query (runQuery) | |
import Database.HDBC.Session (withConnectionIO) |
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 FlexibleContexts #-} | |
{-# LANGUAGE MonadComprehensions #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Database.Test.Query where | |
import Data.Int (Int32) | |
import Data.Time (Day) | |
import Database.HDBC.Record.Query (runQuery) | |
import Database.HDBC.Session (withConnectionIO) |
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 FlexibleContexts #-} | |
{-# LANGUAGE MonadComprehensions #-} | |
module Main where | |
import qualified Language.SQL.Keyword.ConcatString as SQLs | |
import qualified Wifi | |
import Data.Int (Int32, Int64) | |
import Database.HDBC (IConnection, SqlValue) |