Skip to content

Instantly share code, notes, and snippets.

View massysett's full-sized avatar

Omari Norman massysett

  • Prince George's County, Maryland USA
View GitHub Profile
@massysett
massysett / earleytest.hs
Created November 5, 2015 22:55
Test code for Earley parser
#!/usr/bin/env stack
-- stack --resolver=nightly-2015-11-04 --install-ghc runghc --package Earley
{-# LANGUAGE RecursiveDo, RankNTypes #-}
module Main where
import Control.Applicative
import Text.Earley
import System.Environment
module Main where
-- In the following Haddock comment, place point in the first "Lorem
-- ipsum" line and then run M-x fill-paragraph. Nothing will happen.
-- | Lorem ipsum etc Lorem ipsum etc Lorem ipsum etc Lorem ipsum etc Lorem ipsum etc Lorem ipsum etc Lorem ipsum etc Lorem ipsum etc
-- Lorem ipsum etc Lorem ipsum etc
-- But it works fine in the following comment. Place point in the
-- first line of the next comment and run M-x fill-paragraph.
@massysett
massysett / gist:32ec3cc00f8722a415ba
Created January 26, 2015 17:45
Cartel without the header
-- Cartel without the header
module Main where
import Cartel
import System.Exit
getCabal :: Betsy IO Cabal
getCabal = do
-- Assumes of course you have some modules in "lib".
-- Really, since this computation does not make flags, there's
@massysett
massysett / gist:9c493db836705578eef5
Created January 19, 2015 16:06
Fixing Haddock with OS X
I have had problems getting Haddock to function properly on OSX.
See for example:
https://github.com/haskell/cabal/issues/1790
Apparently there is an issue with OS X because it uses Clang, and its
C preprocessor is doing something funny. Previously people reported fixes
by having Haddock pass "-optP-P" to the C compiler, but this has not worked
for me.
Confusing the whole thing is that on OS X /usr/bin/gcc is actually Clang.