Skip to content

Instantly share code, notes, and snippets.

View sergv's full-sized avatar

Sergey Vinokurov sergv

View GitHub Profile
@sergv
sergv / Setup.hs
Last active August 4, 2020 07:40
Stack bug report with preprocessed file
import Distribution.Simple (defaultMainWithHooks)
import Distribution.Simple.UUAGC (uuagcLibUserHook)
import UU.UUAGC (uuagc)
main :: IO ()
main = defaultMainWithHooks $
uuagcLibUserHook uuagc
@sergv
sergv / RecSchemesTypecheck.hs
Last active January 23, 2019 10:57
Use recursion schemes to add type information to expressions in a modular way
----------------------------------------------------------------------------
-- Tested with ghc 8.2.2
----------------------------------------------------------------------------
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TupleSections #-}
@sergv
sergv / BytestringFolds.hs
Created February 13, 2018 22:53
Benchmarks for removal of extra argument from folds in the 'bytestring' package
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
module BytestringFolds (main) where
import Control.DeepSeq
import Control.Exception
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as C8
import qualified Data.ByteString.Internal as BS
@sergv
sergv / keybase.md
Created October 17, 2017 06:28
keybase.md

Keybase proof

I hereby claim:

  • I am sergv on github.
  • I am sergv (https://keybase.io/sergv) on keybase.
  • I have a public key whose fingerprint is 47E4 DA2E 6A3F 58FE 3F01 98F4 D6CD 2953 0F98 D6B8

To claim this, I am signing this object:

@sergv
sergv / install-packages.sh
Last active December 2, 2018 22:05
Install list of haskell packages locally. Create hyperlinked documentation with index. Download package sources and create tags
#! /usr/bin/env bash
#
# File: install-packages.sh
#
# Created: Saturday, 29 October 2016
#
# treat undefined variable substitutions as errors
set -u
# propagate errors from all parts of pipes
@sergv
sergv / gist:7b5dd06aeacf28204db3712fa190342f
Created July 23, 2016 13:38
Catamorphisms in Haskell
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Catamorphisms where
import Data.Foldable
import Data.Monoid