Skip to content

Instantly share code, notes, and snippets.

Christian Takle christiantakle

  • Moixa
  • London
View GitHub Profile
phadej / overlap.hs
Created Jul 1, 2016
OverlappingInstance workarounds
View overlap.hs
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleInstances, FlexibleContexts #-}
{-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeOperators, UndecidableInstances #-}
#if __GLASGOW_HASKELL__ < 708
#error "requires GHC 7.10 or newer"
module Main (main) where
chrisdone /
Last active May 29, 2018
stack hoogle

Introducing the stack hoogle feature!

With the release of hoogle5, we can now hoogle all local packages.

This let us implement stack hoogle, which is on the master branch of stack, but is not yet on a stack release. We'd like you to try it out before we do!

To upgrade to the latest stack from git, use:

dysinger / packages.el
Last active Mar 24, 2020
Private spacemacs layer to try out Chris Done's Intero mode for haskell
View packages.el
;; 1. place this in ~/.emacs.d/private/intero/packages.el
;; 2. add intero, syntax-checking and auto-completion to your
;; ~/.spacemacs layer configuration & remove the haskell layer
;; if you were using that before
;; 3. make sure you have stack installed
;; 4. fire up emacs & open up a stack project's source files
evincarofautumn /
Last active Jan 12, 2020
Thoughts on an InlineDoBind extension

Thoughts on an InlineDoBind extension

An expression beginning with a left arrow (<-) inside a do block statement is desugared to a monadic binding. This is syntactically a superset of existing Haskell, including extensions. It admits a clean notation that subsumes existing patterns and comes with few downsides.


  f (<- x) (<- y)
-- ===
bastman /
Created Mar 31, 2016
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see:

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
Teggy / four-solutions-to-a-trivial-problem.hs
Last active Dec 1, 2019
A Haskell "transcript" of Guy Steele's talk "Four Solutions to a Trivial Problem" (
View four-solutions-to-a-trivial-problem.hs
{-# LANGUAGE TypeSynonymInstances #-}
import Data.Monoid
import Data.Maybe
-- How much water does a "histogram" hold?
-- Inspired by Guy Steele's talk "Four Solutions to a Trivial Problem"
jtobin / fix-free-cofree.hs
Created Dec 9, 2015
Fix, Free, and Cofree
View fix-free-cofree.hs
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
import Prelude hiding (succ)
newtype Fix f = Fix (f (Fix f))
deriving instance (Show (f (Fix f))) => Show (Fix f)
calstad /
Last active Jul 14, 2020
List of resources for TDA

Quick List of Resources for Topological Data Analysis with Emphasis on Machine Learning

This is just a quick list of resourses on TDA that I put together for @rickasaurus after he was asking for links to papers, books, etc on Twitter and is by no means an exhaustive list.

Survey Papers

Both Carlsson's and Ghrist's survey papers offer a very good introduction to the subject

Other Papers and Web Resources

CMCDragonkai /
Last active May 23, 2020
Haskell: Numeric Typeclasses - How numbers work!

Numeric Typeclasses - How numbers work!

Numbers in Haskell are typed of course. They also exist as instances of a numeric typeclass hierarchy. I was confused with converting and working with numbers of different types, and not being sure which functions were polymorphic and could work with different numeric types. So I created a little diagram. Do note that the typeclass hierarchy of Haskell actually does somewhat follow the hierarchy of numbers in Math.

chpatrick / Bake.hs
Last active Sep 15, 2018
Baked-in Storable Vectors Mark II
View Bake.hs
{-# LANGUAGE MagicHash, TupleSections, TemplateHaskell #-}
module Data.Vector.Storable.Bake(bake, unsafeFromAddrLen) where
import Data.Typeable
import qualified Data.Vector.Storable as VS
import Foreign
import GHC.Prim
import GHC.Ptr
import Language.Haskell.TH
You can’t perform that action at this time.