Skip to content

Instantly share code, notes, and snippets.

> {-# LANGUAGE RankNTypes, DataKinds, KindSignatures, GADTs #-}
> import Unsafe.Coerce
> data M = A | B deriving (Show, Eq)
> data V1 :: M -> * where
> V1A :: Int -> V1 A
> V1B :: Double -> V1 B
> V1a :: () -> V1 a
Betty:flamingra lelf$ cabal configure
Resolving dependencies...
Configuring flamingra-0.1.0.0...
Betty:flamingra lelf$ cabal haddock --html-location='/package/$pkg-$version/docs' --contents-location='/package/$pkg-$version'
Running Haddock for flamingra-0.1.0.0...
Preprocessing library flamingra-0.1.0.0...
Haddock coverage:
0% ( 0 / 1) in 'I'mHereOnlyToPleaseHaddock'
Documentation created: dist/doc/html/flamingra/index.html
Betty:fake lelf$ cabal install "mtl-2.2.1" "text-1.2.1.1" "hashable-1.2.3.3" "parsec-3.1.9" "scientific-0.3.3.8" "attoparsec-0.13.0.0"
Resolving dependencies...
All the requested packages are already installed:
hashable-1.2.3.3
mtl-2.2.1
parsec-3.1.9
scientific-0.3.3.8
text-1.2.1.1
Use --reinstall if you want to reinstall anyway.
@llelf
llelf / a.sh
Last active August 29, 2015 14:24
Betty:fake lelf$ cabal --version
cabal-install version 1.22.6.0
using version 1.22.4.0 of the Cabal library
Betty:fake lelf$ cabal install "mtl-2.2.1" "text-1.2.1.1" "hashable-1.2.3.3" "parsec-3.1.9" "scientific-0.3.3.8" "kill-me-666.666"
Resolving dependencies...
All the requested packages are already installed:
hashable-1.2.3.3
mtl-2.2.1
parsec-3.1.9
@llelf
llelf / pi12.hs
Last active December 19, 2015 06:48
module PI where
import Data.Number.CReal
import Data.List
fractPartToBase :: RealFrac x => Int -> x -> [Int]
fractPartToBase base x = unfoldr f x
where f d = Just (d'int, d' - fromIntegral d'int)
where d' = d * fromIntegral base
@llelf
llelf / -
Created January 14, 2016 08:40
$ riak-admin bucket-type create --help
--help created
@llelf
llelf / ip1.hs
Last active March 14, 2020 18:30
{-# LANGUAGE GADTs, ConstraintKinds, Rank2Types, ImplicitParams #-}
data Rec fields where
Rec :: fields => Rec fields
infixr 1 ?
(?) :: Rec fields -> (fields => r) -> r
Rec ? e = e
record :: Rec (?a :: Int, ?b :: String)

Keybase proof

I hereby claim:

  • I am llelf on github.
  • I am lelf (https://keybase.io/lelf) on keybase.
  • I have a public key ASCut-M2ylTC8ta3u74-HP2XbSgF7j7D3u4TTPIObH4YOwo

To claim this, I am signing this object:

@llelf
llelf / etc-hosts
Created September 15, 2017 09:36
Block OSX El Capitan from phoning home
################################################################################
# PRIVACY RULES #
# * OSX EL CAPITAN - NO CONNECTIONS TO CUPPERTINO * #
# MIX OF DIFFERENT /etc/hosts FILES I'VE FOUND. 80% OF THE ENTRIES CAME FROM #
# MY OWN. OSX SENDS HUGE AMMOUNT OF REQUESTS TO CUPPERTINO EVENT WHEN #
# SPOTLIGHT SUGGESTIONS, ICLOUD, AND OTHER SERVICES ARE DISABLED #
# USE IT IF YOU DON'T LIKE OSX CALLING HOME WHEN YOU DON'T WANT IT TO HAPPEN #
# NO CONNECTIONS TO APPLE SERVERS REPORTED BY MY FIREWALL FOR 2 MONTHS #
################################################################################
# SAVED FROM: http://pastebin.com/GfaXGL4r
@llelf
llelf / liftedMonoid.hs
Created May 3, 2018 04:51 — forked from sjoerdvisscher/liftedMonoid.hs
If you have a Functor f with an instance Monoid a => Monoid (f a), f is Applicative!
{-# LANGUAGE TypeOperators, ScopedTypeVariables, TupleSections #-}
import Data.Constraint
import Data.Monoid
import Control.Applicative
pureDefault :: forall f a. Functor f
=> (Monoid () :- Monoid (f ()))
-> a -> f a