Skip to content

Instantly share code, notes, and snippets.

🕶
functional lazy

Herbert Valerio Riedel hvr

🕶
functional lazy
Block or report user

Report or block hvr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hvr
hvr / link_cabal_exe.py
Last active Feb 27, 2017
Quick'n'dirty cabal new-build exe-symlink script
View link_cabal_exe.py
View getExePath.hs
module Main where
import Foreign.C
import Foreign.Marshal.Alloc
import Foreign.Ptr
import Foreign.Storable
import System.Posix.Internals
-- import System.Environment (getExecutablePath)
@hvr
hvr / -
Created Jun 21, 2016
mentions of `String` in haskell2010
View -
Control.Monad: fail :: String -> m a
Data.Char:type String = [Char]
Data.Char:lexLitChar :: ReadS String
Data.List:lines :: String -> [String]
Data.List:unlines :: [String] -> String
Data.List:unwords :: [String] -> String
Data.List:words :: String -> [String]
Foreign:throwIf :: (a -> Bool) -> (a -> String) -> IO a -> IO a
Foreign:throwIfNeg :: (Ord a, Num a) => (a -> String) -> IO a -> IO a
Foreign:throwIfNeg_ :: (Ord a, Num a) => (a -> String) -> IO a -> IO ()
View ManDev.hs
module GenDev where
data Foo = Foo
{ foo :: String
, bar :: Maybe [Int]
, baz :: [Int]
} -- deriving Generic
instance Monoid Foo where
mempty = Foo mempty mempty mempty
View SETrans.hs
{-# LANGUAGE ScopedTypeVariables #-}
import Control.Monad.Identity
import Control.Monad.Except
import Control.Monad.State.Strict
type SET s e m = StateT s (ExceptT e m)
type EST e s m = ExceptT e (StateT s m)
View mk_pkg_table.hs
#!/usr/bin/env runghc
import Data.Char
import Data.List
import Control.Monad
import Control.Applicative
import Data.Monoid
import Data.Version
import Text.ParserCombinators.ReadP (readP_to_S)
@hvr
hvr / gist:d9c08fe0e87075228e41
Last active Aug 29, 2015
CounterArray based on `fetchAddIntArray#`
View gist:d9c08fe0e87075228e41
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE BangPatterns #-}
module RingCounter
( CounterArray
, newCounterArray
, sizeofCounterArray
, readCounterArray
@hvr
hvr / gist:4b7b3074826ccc327a7d
Last active Aug 29, 2015
regen haddock docs
View gist:4b7b3074826ccc327a7d
#!/bin/bash
set -e
PKGID="$1"
PKGN=$(echo "$PKGID" | sed 's,^\(.*\)-\([0-9.]*\)$,\1,')
PKGV=$(echo "$PKGID" | sed 's,^\(.*\)-\([0-9.]*\)$,\2,')
# EDIT ME XXX
CREDS="MyUser:MyPass"
@hvr
hvr / .gitignore
Last active Aug 29, 2015
Git server-side submodule reference validator
@hvr
hvr / report.html
Last active Dec 27, 2015
tests & benchmarks for new integer-gmp import/export primitives
View report.html
{-# LANGUAGE CPP, BangPatterns, MagicHash, UnliftedFFITypes, UnboxedTuples, ScopedTypeVariables #-}
-- | Tests/Benchmarks for new GHC.Integer.GMP.Internals.{import,export}Integer primitives
import Control.Monad
import Criterion.Main
import Data.Bits
import Data.ByteString.Short.Internal (ShortByteString(SBS))
import qualified Data.ByteString.Short.Internal as SBS
import Data.List
You can’t perform that action at this time.