Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex R rpglover64

  • Berkeley
View GitHub Profile
View TestHTTP.hs
module Main where
import System.Environment
import Network.HTTP
main :: IO ()
main = do
url <- fmap head getArgs
r <- simpleHTTP $ getRequest url
getResponseBody r >>= putStrLn
@rpglover64
rpglover64 / main.hs
Created Aug 18, 2015
Example script using turtle
View main.hs
#!/usr/bin/env stack
-- stack --install-ghc runghc --package turtle
{-# LANGUAGE OverloadedStrings #-}
import Turtle
import qualified Data.Text as T
import Data.Traversable
import Data.Foldable
import Data.Either
@rpglover64
rpglover64 / gist:740040c28b725cd93337
Created Jun 5, 2015
Implementation of shuffle for smallcheck
View gist:740040c28b725cd93337
import Test.SmallCheck
import Test.SmallCheck.Series
import Data.Bifunctor
import Control.Monad
-- Based on the implementation in quickcheck: http://hackage.haskell.org/package/QuickCheck-2.8.1/docs/src/Test-QuickCheck-Gen.html#shuffle
shuffle [] = return []
shuffle xs = do
(y, ys) <- uncurry mplus $ bimap msum msum $ bimap (map return) (map $ decDepth . return) $ splitAt 1 $ selectOne xs
(y:) <$> decDepthChecked (return ys) (shuffle ys)
@rpglover64
rpglover64 / ghc-mod.el
Created Mar 16, 2015
Work in progress on using ghc-mod for flycheck.
View ghc-mod.el
(flycheck-define-checker haskell-ghc-mod
"A Haskell syntax and type checker using ghc-mod."
:command ("ghc-mod" "check" source)
:error-patterns
((warning line-start (file-name) ":" line ":" column ":"
"Warning:" (zero-or-more space)
(message (one-or-more not-newline))
line-end)
(error line-start (file-name) ":" line ":" column ":"
(zero-or-more space)
View honor-with-compiler.patch
diff --git a/flycheck-haskell.el b/flycheck-haskell.el
index a51b879..d263e1e 100644
--- a/flycheck-haskell.el
+++ b/flycheck-haskell.el
@@ -143,6 +143,9 @@ Return the configuration."
(or (flycheck-haskell-get-cached-configuration cabal-file)
(flycheck-haskell-read-and-cache-configuration cabal-file)))
+(defconst flycheck-haskell-cabal-config "cabal.config"
+ "The file name of a Cabal configuration.")
View keybase.md

Keybase proof

I hereby claim:

  • I am rpglover64 on github.
  • I am rpglover64 (https://keybase.io/rpglover64) on keybase.
  • I have a public key whose fingerprint is D67E 2F23 C618 B5F8 0C18 C527 378E 4A39 EADE 0FBD

To claim this, I am signing this object:

@rpglover64
rpglover64 / ziplist.hs
Last active Aug 29, 2015
Using OverloadedLists and applicative-quoters together.
View ziplist.hs
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE QuasiQuotes #-}
import GHC.Exts
import Control.Applicative
import Control.Applicative.QQ.Idiom
-- Note that this is an orphan instance.
instance IsList (ZipList a) where
View Waterflow.hs
{-# LANGUAGE TupleSections #-}
module Waterflow
where
import Control.Applicative
import Data.Map (Map)
import qualified Data.Map as M
import Test.QuickCheck
@rpglover64
rpglover64 / 0001-glasgow-exts.patch
Last active Dec 17, 2015
Patch removing -fglasgow-exts
View 0001-glasgow-exts.patch
From ee58a991f599b4cae769ece59a86c9afcf7ec0e9 Mon Sep 17 00:00:00 2001
From: Alex Rozenshteyn <rpglover64@gmail.com>
Date: Wed, 29 May 2013 15:25:05 -0400
Subject: [PATCH 1/2] foo
---
source/src/BNFC/Backend/HaskellGADT.hs | 2 +-
source/src/BNFC/Backend/HaskellGADT/CFtoAbstractGADT.hs | 2 +-
source/src/BNFC/Backend/HaskellGADT/CFtoPrinterGADT.hs | 2 +-
source/src/BNFC/Backend/HaskellGADT/CFtoTemplateGADT.hs | 1 +
@rpglover64
rpglover64 / brew info fontconfig
Created Oct 20, 2012
fontconfig can't handle the --universal option
View brew info fontconfig
fontconfig: stable 2.10.1
http://fontconfig.org/
Depends on: freetype, pkg-config
Not installed
https://github.com/mxcl/homebrew/commits/master/Library/Formula/fontconfig.rb
==> Options
--universal
Build a universal binary
You can’t perform that action at this time.