Skip to content

Instantly share code, notes, and snippets.

mgsloan@computer:~/fpco/ghc-7.10-sandbox$ hsenv --ghc=../ghc-7.10.1.tar.xz
Creating Virtual Haskell directory structure
Installing GHC
Installing GHC from ../ghc-7.10.1.tar.xz
Initializing GHC Package database at /home/mgsloan/fpco/ghc-7.10-sandbox/.hsenv/ghc_pkg_db
Copying necessary packages from original GHC package database
Using user-wide (~/.cabal/packages) Hackage download cache directory
Installing cabal config at /home/mgsloan/fpco/ghc-7.10-sandbox/.hsenv/cabal/config
Installing activate script
Installing cabal wrapper using /home/mgsloan/fpco/ghc-7.10-sandbox/.hsenv/cabal/config at /home/mgsloan/fpco/ghc-7.10-sandbox/.hsenv/bin/cabal
import Control.Concurrent (threadDelay)
import Control.Concurrent.Async (async, poll, cancel)
import Control.Concurrent.STM (atomically, newTVarIO, readTVar, writeTVar, check)
import Control.Exception (uninterruptibleMask)
main :: IO ()
main = do
-- Block on a 'TVar', under an 'uninterruptibleMask'. I would
-- expect this to mean that the thread isn't canceleable, and only
-- finishes when 'var' is set to 'True'.
-- | This code is from an FP Complete internal tool, and isn't
-- necessarily fit for packaging. It's released under the MIT
-- license.
module ExtractTopLevel (main) where
import Data.Char (isSpace)
import Data.Generics.Schemes (listify)
import Data.List (find)
import qualified Language.Haskell.Exts as Simple
import Language.Haskell.Exts.Annotated
{-# LANGUAGE TemplateHaskell #-}
import AddTopDecls
main = print $testAddTopDecls
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DeriveDataTypeable #-}
module Test5 where
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad.Trans
import GHCJS.DOM
import GHCJS.DOM.Node
import Style
import Util
@mgsloan
mgsloan / haskell-highlighting.md
Created November 20, 2014 22:25
Github haskell highlighting issues

Hello!

Github is awesome! However, a minor issue report:

Very recently the code highlighting changed, to the detriment of haskell highlighting. Others have noticed too, an example comment: https://github.com/chrisdone/hindent/issues/36#issuecomment-63157052

The old highlighting doesn't need to come back, however, here are a couple immediately apparent issues:

  1. The last type in a function type signature seems to get a different color, for no good reason
-- | Load all of the hints at compile time.
hlintFixities :: [HSE.Fixity]
hlintClassifies :: [Classify]
hlintBuiltins :: [String]
hlintRules :: [HintRule]
(hlintFixities, hlintClassifies, hlintBuiltins, hlintRules) =
$(do let dataDir = "../learning-site/config/hlint/"
(builtin, matches) <- TH.qRunIO $ findSettings dataDir (dataDir </> "HLint.hs") Nothing
let (classify, rules) = concat2 $ map readSettings matches
-- All of these helpers are copied from HLint
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
module Slogger where
@mgsloan
mgsloan / Vacuum.hs
Last active December 20, 2015 04:09
import GHC.Vacuum
import GHC.Vacuum.GraphViz
import Data.GraphViz
lazyVacuumToPng :: FilePath -> a -> IO FilePath
lazyVacuumToPng fp x = graphToDotFile fp Png $ nameGraph (vacuumLazy x)
main :: IO ()
main = do
lazyVacuumToPng "beforeForce" xs