This file contains hidden or 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 Data.Monoid | |
λ> let s = take 20000000 $ repeat 'a' | |
λ> :set +s | |
λ> length $ appEndo(Endo (s ++) `mappend` Endo (s ++) ) [] | |
40000000 | |
(0.86 secs, 2242175512 bytes) | |
λ> length $ appEndo(Endo (++ s) `mappend` Endo (++ s) ) [] | |
40000000 | |
(0.26 secs, 1121875736 bytes) | |
λ> length $ appEndo(Endo (++ s) `mappend` Endo (++ s)`mappend` Endo (++ s) ) [] |
This file contains hidden or 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 Test where | |
import Data.Aeson | |
import Data.Aeson.TH | |
data D a = Nullary | |
| Unary Int | |
| Product String Char a | |
| Record { testOne :: Double | |
, testTwo :: Bool |
This file contains hidden or 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.Monad.IO.Class | |
import Data.Conduit | |
import Data.Conduit.Binary as B | |
import Data.Conduit.List as L | |
import Data.Char | |
import Data.Word | |
{- | |
% cat input.txt | |
upload |
This file contains hidden or 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
Test.Api: | |
imports: [OK] | |
Test.CommandLine: | |
executable: [OK] | |
compile: [OK] | |
Tests: | |
tests/Bool.hs: [Failed] | |
tests/Bool.hs | |
expected: "true\n" | |
but got: "\"\"" |
This file contains hidden or 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
/usr/bin/ghc --make -o dist/build/image-tests/image-tests -hide-all-packages -fbuilding-cabal-package -no-user-package-conf -package-conf /home/qrilka/ws/h/imagemagick/cabal-dev/packages-7.4.2.conf -package-conf dist/package.conf.inplace -i -idist/build/image-tests/image-tests-tmp -itest -idist/build/autogen -Idist/build/autogen -Idist/build/image-tests/image-tests-tmp -I/usr/include/ImageMagick -optP-include -optPdist/build/autogen/cabal_macros.h -odir dist/build/image-tests/image-tests-tmp -hidir dist/build/image-tests/image-tests-tmp -stubdir dist/build/image-tests/image-tests-tmp -package-id base-4.5.1.0-6e4c9bdc36eeb9121f27ccbbcb62e3f3 -package-id bytestring-0.9.2.1-503e91bb155301fdb1956cb5c26ce6e9 -package-id resourcet-0.3.3.1-182a1ca09ebcb9fc1bcb2ce57788ad87 -package-id system-filepath-0.4.6-7429ac4af37fea8041e561e843fbebab -package-id text-0.11.2.2-cfa666ca84ce29f62e4ae7a77a6a12b0 -package-id transformers-0.3.0.0-8e66ecc7d4dae2b07b2b5406908c70e4 -package-id vector-0.9.1-a53ef929a177848238ea99fa7fe6688 |
This file contains hidden or 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 Control.Monad (when) | |
import Control.Applicative ((<|>)) | |
import Data.List | |
import Data.Maybe | |
import Debug.Trace | |
pS :: String -> Maybe String |
This file contains hidden or 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
test3 = c $// element "row" >=> parseRow | |
where | |
doc = case X.parseLBS def xml2 of | |
Right d -> d | |
Left _ -> error "invalid xml" | |
c = fromDocument doc | |
parseRow c = do | |
h <- c $| attribute "height" | |
return [(h, c $/ element "cell" >=> attribute "t")] |
This file contains hidden or 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
\documentclass[9pt,a4paper]{article} | |
\usepackage[utf8]{inputenc} | |
\usepackage[english,russian]{babel} | |
\usepackage{PTSerif} | |
\usepackage{array} | |
\begin{document} | |
\begin{tabular}{| m{1cm} | p{5cm} | b{1cm} |} | |
\hline | |
boo & |
This file contains hidden or 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
instance (Random a, Bounded a) => Random (a,a) where randomR = randomPairR; random = randomPair | |
randomPairR :: (RandomGen g, Random a) => ((a,a), (a,a)) -> g -> ((a,a), g) | |
randomPairR ((l1,h1),(l2,h2)) g = ((v1, v2), g'') | |
where | |
(v1, g') = randomR (l1,h1) g | |
(v2, g'') = randomR (l2,h2) g' | |
randomPair :: (RandomGen g, Random a, Bounded a) => g -> ((a,a), g) | |
randomPair = randomPairR ((minBound, maxBound), (minBound, maxBound)) |
This file contains hidden or 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 XMonad | |
import XMonad.Hooks.DynamicLog | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Util.EZConfig (additionalKeys) | |
import XMonad.Layout.NoBorders (smartBorders) | |
import System.IO | |
import DBus.Client.Simple | |
import System.Taffybar.XMonadLog (dbusLog) | |
main = do |