Skip to content

Commit

Permalink
Modernise pragmas and extensions, fix use of State
Browse files Browse the repository at this point in the history
  • Loading branch information
bmillwood committed Dec 8, 2010
1 parent d4b244b commit 4c36411
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
2 changes: 0 additions & 2 deletions Plugin/Pl/Common.hs
@@ -1,5 +1,3 @@
{-# OPTIONS -fvia-C #-}

module Plugin.Pl.Common (
Fixity(..), Expr(..), Pattern(..), Decl(..), TopLevel(..),
bt, sizeExpr, mapTopLevel, mapTopLevel', getExpr,
Expand Down
2 changes: 1 addition & 1 deletion Plugin/Pl/Optimize.hs
@@ -1,4 +1,4 @@
{-# OPTIONS -fvia-C -O2 -optc-O3 #-}
{-# LANGUAGE ImplicitParams #-}
module Plugin.Pl.Optimize (
optimize,
) where
Expand Down
1 change: 0 additions & 1 deletion Plugin/Pl/Parser.hs
@@ -1,4 +1,3 @@
{-# OPTIONS -fvia-C -O2 -optc-O3 #-}
--
-- Todo, use Language.Haskell
--
Expand Down
3 changes: 2 additions & 1 deletion Plugin/Pl/PrettyPrinter.hs
@@ -1,4 +1,5 @@
{-# OPTIONS -fvia-C -fno-warn-orphans #-}
{-# LANGUAGE PatternGuards #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Plugin.Pl.PrettyPrinter (Expr) where

-- Dummy export to make ghc -Wall happy
Expand Down
7 changes: 3 additions & 4 deletions Plugin/Pl/Rules.hs
@@ -1,7 +1,6 @@
{-# OPTIONS -fvia-C #-}
{-# OPTIONS -fno-warn-name-shadowing #-}
-- 6.4 gives a name shadow warning I haven't tracked down.

{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
--
-- | This marvellous module contributed by Thomas J\344ger
--
Expand Down
4 changes: 2 additions & 2 deletions Plugin/Pl/Transform.hs
@@ -1,4 +1,4 @@
{-# OPTIONS -fvia-C -O2 -optc-O3 #-}
{-# LANGUAGE FlexibleInstances #-}
module Plugin.Pl.Transform (
transform,
) where
Expand Down Expand Up @@ -74,7 +74,7 @@ alphaRename e = alpha e `evalState` M.empty where

-- act like a reader monad
inEnv :: State s a -> State s a
inEnv (State f) = State $ \s -> (fst $ f s, s)
inEnv f = gets $ evalState f

alphaPat (PVar v) = do
fm <- get
Expand Down
5 changes: 5 additions & 0 deletions pointfree.cabal
Expand Up @@ -24,6 +24,11 @@ Source-repository head
Executable pointfree
Main-is: Main.hs
GHC-options: -Wall
Extensions: ExistentialQuantification,
FlexibleInstances,
ImplicitParams,
PatternGuards,
ScopedTypeVariables
Build-depends: base >= 3 && < 4.4,
array >= 0.3 && < 0.4,
containers >= 0.3 && < 0.5,
Expand Down

0 comments on commit 4c36411

Please sign in to comment.