Skip to content

Instantly share code, notes, and snippets.

@neongreen
neongreen / default.nix
Last active November 9, 2019 22:15
nix-shell with custom Haskell packages
with import <nixpkgs> { };
let
proto3-wire-src = fetchFromGitHub {
owner = "awakenetworks";
repo = "proto3-wire";
rev = "4f355bbac895d577d8a28f567ab4380f042ccc24";
sha256 = "16l1rnnygwk1b2sb3l6klhr6ad0wvry204icxnc81c6rbzbk6rqc";
};
module Pipes.Core
( -- * Proxy Monad Transformer
-- $proxy
Proxy
, runEffect
, -- * Categories
-- $categories
-- ** Respond
-- $respond
module Pipes.Core (
-- * Proxy Monad Transformer
-- $proxy
Proxy
, runEffect
-- * Categories
-- $categories
-- ** Respond
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE TypeApplications #-}
class Voodoo tag where
-- Let's define an operation that requires TypeApplications in order to work
voodoo :: Int -> String
-- Let's also have an instance (we could have more, of course)
data Tag
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE TypeApplications #-}
class Voodoo tag where
-- Let's define an operation that requires TypeApplications in order to work
voodoo :: Int -> String
-- Let's also have an instance (we could have more, of course)
data Tag
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ApplicativeDo #-}
module Main where
import Data.Default
import Network.HTTP.Req
import Data.Time.Calendar
> putStrLn $ drawVerticalTree (Node g [Node g [], Node g [Node g [], Node g [], Node g []]])
┌───────┐
│ o o . │
│ o x x │
│ . . . │
└───────┘
|
---------------------
/ \
┌───────┐ ┌───────┐
> putStrLn $ drawVerticalTree (Node g [Node g [], Node g [Node g [], Node g []]])
+-----+
|o o .|
|o x x|
|. . .|
+-----+
|
------------
/ \
+-----+ +-----+
Unqualified:
5888 $
4924 .
1762 <$>
1018 <>
777 <*>
468 ^
406 *
367 >>=
[1 of 1] Compiling Main ( Setup.hs, /private/var/folders/nb/8rlykx_x2hj2dgcpnt0js9q40000gn/T/nix-build-old-time-1.1.0.3.drv-0/Main.js_o )
Linking Setup.jsexe (Main)
configuring
configureFlags: --verbose --prefix=/nix/store/jsnqh4qnhcw2dn1b64bjs9h0l1qv7f0l-old-time-1.1.0.3 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --docdir=/nix/store/7kfjs2v4lfq4vyqfpmv4z7a3ax4zr5aq-old-time-1.1.0.3-doc/share/doc --with-gcc=clang --package-db=/private/var/folders/nb/8rlykx_x2hj2dgcpnt0js9q40000gn/T/nix-build-old-time-1.1.0.3.drv-0/package.conf.d --ghc-option=-optl=-Wl,-headerpad_max_install_names --disable-split-objs --disable-library-profiling --disable-executable-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --disable-tests --ghcjs --extra-include-dirs=/nix/store/9vpq5wm8fd8177cpfx6vlvqfrk7kb7aw-libiconv-osx-10.11.6/include --extra-lib-dirs=/nix/store/9vpq5wm8fd8177cpfx6vlvqfrk7kb7aw-libiconv-osx-10.11.6/lib --extra-lib-dirs=/nix/store/sknn9xvnf19fyrwd7axrv3fg31ghadq8-ghc-