Skip to content

Instantly share code, notes, and snippets.

🕶️
functional lazy

Herbert Valerio Riedel hvr

🕶️
functional lazy
View GitHub Profile
View Cabal 3.2 Ann.md

Cabal 3.2 Release & Recent Hackage/Cabal3 Server Update

Cabal 3.2 has finally been released, including new bug fixes, features, and a Hackage Server update. You can find the project Changelog on github if you want the rest of the changeset between this version and Cabal 3.0.

In this post, we'll go over some of the highlights in this release, as well as detail some upcomings line items and milestones for future planned work on the library.

Highlights & Bugfixes

The 3.2 changeset features the following:

@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
You can’t perform that action at this time.