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
import Control.Arrow ((***), second) | |
import Data.Array | |
import Data.Function (on) | |
import Data.List (minimumBy) | |
data Action = Ins | |
| Del | |
| Sub | |
| Id | |
deriving Show |
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 LinearSelection where | |
import System.Random (randomRIO) | |
import System.IO.Unsafe (unsafePerformIO) | |
select :: Ord a => [a] -> Int -> a | |
select [x] 1 = x | |
select xs n | |
| n > length xs || n <= 0 = error $ "select: wrong index (" ++ show n ++ ") where length is " ++ show (length xs) | |
| length ls < n = select bs (n - length ls) |
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
import Test.QuickCheck | |
import Tree | |
prop_id [] = True | |
prop_id xs = xs == (toList . fromList) xs | |
prop_elem x xs = (x `elem` xs) == (x `elemTree` fromList xs) |
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 UnicodeSyntax #-} | |
module Queue | |
( Queue | |
, isEmpty | |
, ($*), head, tail | |
, size | |
, fromList | |
) where | |
import Data.List (foldl') |
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 UnicodeSyntax #-} | |
module Main (main) where | |
import Control.Applicative ((<$>)) | |
import Control.Monad (foldM, when) | |
import Control.Monad.ST (ST) | |
import Control.Parallel (par) | |
import Data.Array (elems) | |
import Data.Array.ST (STArray, newListArray, readArray, runSTArray, writeArray) | |
import Data.Char (toUpper) |
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 TemplateHaskell #-} | |
module Pisya where | |
import PisyaTH | |
$(anal ["pemis", "gnoi", "sosiska", "sobachka"]) |
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 UnicodeSyntax #-} | |
module NFA | |
( single, (×), (⧺), star | |
) where | |
import Data.Maybe (fromMaybe, mapMaybe) | |
import Prelude hiding (concat) | |
import qualified Prelude | |
data NFA p = NFA { match ∷ (p → Maybe [p]) } |
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 UnicodeSyntax #-} | |
module Main where | |
import Control.Applicative ((<$>)) | |
import Control.Monad (forM_, when) | |
import Control.Monad.State (execState, modify) | |
import Data.Bits (Bits, xor) | |
import Data.Char (chr, isAlpha) | |
import Data.List (maximumBy, group, sort, zip4) | |
import Data.List.Split (splitEvery) |
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 UnicodeSyntax #-} | |
module Main where | |
import Control.Applicative ((<$>)) | |
import Data.List (foldr1) | |
import Graphics.GD (copyRegion, loadPngFile, newImage, savePngFile) | |
import System.Directory (getCurrentDirectory, getDirectoryContents) | |
import System.FilePath ((</>)) | |
main ∷ IO () |
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 UnicodeSyntax #-} | |
module Main where | |
import Control.Applicative ((<$>)) | |
import System.Directory (getDirectoryContents) | |
import System.FilePath ((</>)) | |
import Data.Array.Repa.IO.DevIL | |
import qualified Data.Array.Repa as R | |
main ∷ IO () |
OlderNewer