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
cygnus=# create table parent (a text not null primary key); | |
CREATE TABLE | |
cygnus=# create table child (a text not null primary key references parent(a) on delete cascade on update cascade); | |
CREATE TABLE | |
cygnus=# insert into parent (a) values ('foobar'); | |
INSERT 0 1 | |
cygnus=# insert into parent (a) values ('foo__bar'); | |
INSERT 0 1 | |
cygnus=# insert into child (a) values ('foo'); | |
ERROR: insert or update on table "child" violates foreign key constraint "child_a_fkey" |
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 TupleSections #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Lens.Micro.Platform ((^.), _1, (%~), (&), ix) | |
import Control.Monad (void) | |
import Data.Monoid | |
import Data.Maybe (fromMaybe) | |
import qualified Graphics.Vty as V |
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 RLE where | |
import Control.Applicative | |
import Data.Monoid | |
newtype RLE a = RLE [(Int, a)] | |
instance Monoid (RLE a) where | |
mempty = RLE [] | |
mappend (RLE as) (RLE bs) = RLE (as `mappend` bs) |
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 Main where | |
import Text.ParserCombinators.Parsec | |
( Parser | |
, parse | |
, string |
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
{-# OPTIONS_GHC -Wall #-} | |
{-# LANGUAGE GADTs #-} | |
module Rules | |
( Rule(Rule) | |
, foreach | |
, failRule | |
, apply | |
, ruleDoc | |
) | |
where |