Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
import Data.Kind
import Data.Coerce
-- type synonyms
--------------------------------------------------------------------------------
@mightybyte
mightybyte / WidgetTypes.hs
Last active May 30, 2017 22:09
FRP Widgets
data WidgetConfig t a
= WidgetConfig { _widgetConfig_setValue :: Event t a
, _widgetConfig_initialValue :: a
, _widgetConfig_attributes :: Dynamic t (Map String String)
}
makeLenses ''WidgetConfig
instance (Reflex t, Default a) => Default (WidgetConfig t a) where
def = WidgetConfig { _widgetConfig_setValue = never
@acfoltzer
acfoltzer / gist:7188179
Last active December 26, 2015 17:39
Haskell.org Committee Self-Nomination

Dear Committee,

I'm writing to nominate myself for a position on the haskell.org committee.

As a working Haskell developer at Galois, having reliable infrastructure is deeply important to me, and I would like to help maintain it however I can. I have experience maintaining web, mail, and IRC servers, as well as acquiring and configuring SSL certificates for those services. I hope that these skills may prove of use to the committee.

I also believe this is a critical point in the growth of our community. As adoption of Haskell increases, the decisions we make now will shape how our community develops, for good or for bad. I was moved by Chung-chieh Shan's [Haskell 2013 Program Chair report][1]. As he says, it can be hard work to speak one's mind with compassion, but let me try so that you can know better my concerns and what I hope to work towards.

I believe that a lack of diversity is one of the primary problems facing the Haskell community today. Ashe Dryden recently spoke at Galois and gave an excellent

@seanparsons
seanparsons / gist:6429556
Last active December 22, 2015 06:18
Possibly parallel and memoised fibonacci.
import Control.Parallel
nfib :: Int -> Int
nfib = (map fib [0 ..] !!)
where fib 0 = 0
fib 1 = 1
fib n = par n1 (pseq n2 (n1 + n2))
where n2 = nfib (n-2)
n1 = nfib (n-1)
@NicolasT
NicolasT / reconnect.hs
Created June 9, 2013 21:40
Auto-reconnecting Conduit sink with user-defined backoff
{-# LANGUAGE RankNTypes, OverloadedStrings #-}
module Main (main) where
import Control.Monad (guard)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Trans.Resource (register, release)
import Control.Exception (tryJust)
import GHC.IO.Exception
import Foreign.C.Error
{ config, pkgs, ... }:
{
require = [ <nixos/modules/installer/scan/not-detected.nix> ];
boot = {
initrd = {
kernelModules = [ "ata_piix" "ahci" ];
luks.devices = [{ name = "luks"; device = "/dev/sda2"; preLVM = true; }];
};
loader.grub.device = "/dev/sda";
};