pointfree-fancy 1.1.1.11 → 1.1.1.12
raw patch · 4 files changed
+22/−25 lines, 4 filesdep ~QuickCheckdep ~haskell-src-extsPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: QuickCheck, haskell-src-exts
API changes (from Hackage documentation)
- Plugin.Pl.Common: (&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
- Plugin.Pl.Common: (***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c')
- Plugin.Pl.Common: (+++) :: ArrowChoice a => a b c -> a b' c' -> a Either b b' Either c c'
- Plugin.Pl.Common: (|||) :: ArrowChoice a => a b d -> a c d -> a Either b c d
- Plugin.Pl.Common: App :: Expr -> Expr -> Expr
- Plugin.Pl.Common: AssocLeft :: l -> Assoc l
- Plugin.Pl.Common: AssocNone :: l -> Assoc l
- Plugin.Pl.Common: AssocRight :: l -> Assoc l
- Plugin.Pl.Common: Define :: String -> Expr -> Decl
- Plugin.Pl.Common: Inf :: Fixity
- Plugin.Pl.Common: Lambda :: Pattern -> Expr -> Expr
- Plugin.Pl.Common: Let :: [Decl] -> Expr -> Expr
- Plugin.Pl.Common: PCons :: Pattern -> Pattern -> Pattern
- Plugin.Pl.Common: PTuple :: Pattern -> Pattern -> Pattern
- Plugin.Pl.Common: PVar :: String -> Pattern
- Plugin.Pl.Common: Pref :: Fixity
- Plugin.Pl.Common: TLD :: Bool -> Decl -> TopLevel
- Plugin.Pl.Common: TLE :: Expr -> TopLevel
- Plugin.Pl.Common: Var :: Fixity -> String -> Expr
- Plugin.Pl.Common: [declExpr] :: Decl -> Expr
- Plugin.Pl.Common: [declName] :: Decl -> String
- Plugin.Pl.Common: assert :: () => Bool -> a -> a
- Plugin.Pl.Common: bt :: a
- Plugin.Pl.Common: comp :: Expr
- Plugin.Pl.Common: cons :: Expr
- Plugin.Pl.Common: const' :: Expr
- Plugin.Pl.Common: data Assoc l
- Plugin.Pl.Common: data Decl
- Plugin.Pl.Common: data Expr
- Plugin.Pl.Common: data Fixity
- Plugin.Pl.Common: data Pattern
- Plugin.Pl.Common: data TopLevel
- Plugin.Pl.Common: first :: Arrow a => a b c -> a (b, d) (c, d)
- Plugin.Pl.Common: fix' :: Expr
- Plugin.Pl.Common: flip' :: Expr
- Plugin.Pl.Common: fromJust :: () => Maybe a -> a
- Plugin.Pl.Common: fromMaybe :: () => a -> Maybe a -> a
- Plugin.Pl.Common: getList :: Expr -> ([Expr], Expr)
- Plugin.Pl.Common: id' :: Expr
- Plugin.Pl.Common: if' :: Expr
- Plugin.Pl.Common: infixr 2 +++
- Plugin.Pl.Common: infixr 3 &&&
- Plugin.Pl.Common: instance GHC.Classes.Eq Plugin.Pl.Common.Decl
- Plugin.Pl.Common: instance GHC.Classes.Eq Plugin.Pl.Common.Expr
- Plugin.Pl.Common: instance GHC.Classes.Eq Plugin.Pl.Common.Fixity
- Plugin.Pl.Common: instance GHC.Classes.Eq Plugin.Pl.Common.Pattern
- Plugin.Pl.Common: instance GHC.Classes.Eq Plugin.Pl.Common.TopLevel
- Plugin.Pl.Common: instance GHC.Classes.Ord Plugin.Pl.Common.Decl
- Plugin.Pl.Common: instance GHC.Classes.Ord Plugin.Pl.Common.Expr
- Plugin.Pl.Common: instance GHC.Classes.Ord Plugin.Pl.Common.Fixity
- Plugin.Pl.Common: instance GHC.Classes.Ord Plugin.Pl.Common.Pattern
- Plugin.Pl.Common: instance GHC.Classes.Ord Plugin.Pl.Common.TopLevel
- Plugin.Pl.Common: instance GHC.Show.Show Plugin.Pl.Common.Decl
- Plugin.Pl.Common: instance GHC.Show.Show Plugin.Pl.Common.Expr
- Plugin.Pl.Common: instance GHC.Show.Show Plugin.Pl.Common.Fixity
- Plugin.Pl.Common: instance GHC.Show.Show Plugin.Pl.Common.Pattern
- Plugin.Pl.Common: instance GHC.Show.Show Plugin.Pl.Common.TopLevel
- Plugin.Pl.Common: intersperse :: () => a -> [a] -> [a]
- Plugin.Pl.Common: isJust :: () => Maybe a -> Bool
- Plugin.Pl.Common: lookupFix :: String -> (Assoc (), Int)
- Plugin.Pl.Common: makeList :: [Expr] -> Expr
- Plugin.Pl.Common: mapTopLevel :: (Expr -> Expr) -> TopLevel -> TopLevel
- Plugin.Pl.Common: mapTopLevel' :: Functor f => (Expr -> f Expr) -> TopLevel -> f TopLevel
- Plugin.Pl.Common: maxPrec :: Int
- Plugin.Pl.Common: minPrec :: Int
- Plugin.Pl.Common: minimumBy :: Foldable t => a -> a -> Ordering -> t a -> a
- Plugin.Pl.Common: nil :: Expr
- Plugin.Pl.Common: readM :: (Monad m, Read a) => String -> m a
- Plugin.Pl.Common: scomb :: Expr
- Plugin.Pl.Common: second :: Arrow a => a b c -> a (d, b) (d, c)
- Plugin.Pl.Optimize: optimize :: Expr -> [Expr]
- Plugin.Pl.Parser: parsePF :: String -> Either String TopLevel
- Plugin.Pl.PrettyPrinter: instance GHC.Show.Show Plugin.Pl.PrettyPrinter.SExpr
- Plugin.Pl.PrettyPrinter: prettyDecl :: Decl -> String
- Plugin.Pl.PrettyPrinter: prettyExpr :: Expr -> String
- Plugin.Pl.PrettyPrinter: prettyTopLevel :: TopLevel -> String
- Plugin.Pl.Rules: CRR :: (Expr -> Maybe Expr) -> RewriteRule
- Plugin.Pl.Rules: Down :: RewriteRule -> RewriteRule -> RewriteRule
- Plugin.Pl.Rules: Hard :: RewriteRule -> RewriteRule
- Plugin.Pl.Rules: If :: RewriteRule -> RewriteRule -> RewriteRule
- Plugin.Pl.Rules: Opt :: RewriteRule -> RewriteRule
- Plugin.Pl.Rules: Or :: [RewriteRule] -> RewriteRule
- Plugin.Pl.Rules: OrElse :: RewriteRule -> RewriteRule -> RewriteRule
- Plugin.Pl.Rules: RR :: Rewrite -> Rewrite -> RewriteRule
- Plugin.Pl.Rules: Then :: RewriteRule -> RewriteRule -> RewriteRule
- Plugin.Pl.Rules: Up :: RewriteRule -> RewriteRule -> RewriteRule
- Plugin.Pl.Rules: data RewriteRule
- Plugin.Pl.Rules: fire :: Rewrite -> Rewrite -> Expr -> Maybe Expr
- Plugin.Pl.Rules: instance GHC.Classes.Eq Plugin.Pl.Rules.MExpr
- Plugin.Pl.Rules: instance Plugin.Pl.Rules.RewriteC Plugin.Pl.Rules.MExpr
- Plugin.Pl.Rules: instance Plugin.Pl.Rules.RewriteC a => Plugin.Pl.Rules.RewriteC (Plugin.Pl.Rules.MExpr -> a)
- Plugin.Pl.Rules: rules :: RewriteRule
- Plugin.Pl.Transform: transform :: Expr -> Expr
+ Pointfree: pointfree :: String -> [String]
+ Pointfree: pointfree' :: String -> Maybe String
Files
- pointfree-fancy.cabal +5/−5
- src/Plugin/Pl/Rules.hs +11/−12
- src/Plugin/Pl/Transform.hs +3/−5
- test/Test.hs +3/−3
pointfree-fancy.cabal view
@@ -1,12 +1,12 @@ cabal-version: 2.0 name: pointfree-fancy-version: 1.1.1.11+version: 1.1.1.12 license: BSD3 license-file: LICENSE maintainer: Vanessa McHale <vamchale@gmail.com> author: Thomas Jäger-tested-with: ghc ==8.0.2 ghc ==8.2.2 ghc ==8.4.3 ghc ==7.10.3- ghc ==8.6.1+tested-with: ghc ==8.0.2 ghc ==8.2.2 ghc ==8.4.4 ghc ==7.10.3+ ghc ==8.6.4 synopsis: Tool for refactoring expressions into pointfree form description: The pointfree tool is a standalone command-line version of the pl@@ -48,7 +48,7 @@ base >=4.8 && <5.0, array >=0.3 && <0.6, containers >=0.4 && <0.7,- haskell-src-exts >=1.18 && <1.21,+ haskell-src-exts >=1.20 && <1.21, transformers <0.6 executable pointfree@@ -69,4 +69,4 @@ base <5, pointfree-internal -any, HUnit >=1.1 && <1.7,- QuickCheck >=2.1 && <2.11+ QuickCheck >=2.1 && <2.12
src/Plugin/Pl/Rules.hs view
@@ -164,7 +164,7 @@ sndE, dollarE, constE, uncurryE, curryE, compE, headE, tailE, sE, commaE, fixE, foldl1E, notE, equalsE, nequalsE, plusE, multE, zeroE, oneE, lengthE, sumE, productE, concatE, concatMapE, joinE, mapE, fmapE, fmapIE, subtractE,- minusE, liftME, apE, liftM2E, seqME, zipE, zipWithE, onE, oedipusE, comp2E,+ minusE, liftME, apE, liftM2E, seqME, zipE, zipWithE, onE, oedipusE, oedipus2E, comp2E, crossE, firstE, secondE, andE, orE, allE, anyE, returnE, fishE, mfishE, needleE, mneedleE :: MExpr idE = Quote $ Var Pref "id"@@ -174,8 +174,8 @@ comp2E = Quote $ Var Inf ".*" comp3E = Quote $ Var Inf ".**" eyeE = Quote $ Var Inf "<&>"-oedipusE = Quote $ Var Inf "-.*"-oedipus2E = Quote $ Var Inf "-.**"+oedipusE = Quote $ Var Inf ".@"+oedipus2E = Quote $ Var Inf ".@@" onE = Quote $ Var Pref "on" ampersandE = Quote $ Var Inf "&" sE = Quote $ Var Pref "ap"@@ -249,7 +249,6 @@ infixr 8 `c2` infixr 8 `o` - collapseLists :: Expr -> Maybe Expr collapseLists (Var _ "++" `App` e1 `App` e2) | (xs,x) <- getList e1, x==nil,@@ -311,10 +310,10 @@ -- (f .** g) x y z -> f (g x y z) rr0 (\f g x y z -> (f `c3` g) `a` x `a` y `a` z) (\f g x y z -> f `a` (g `a` x `a` y `a` z)),- -- (f -.* g) x y -> f x (g y)+ -- (f .@ g) x y -> f x (g y) rr0 (\f g x y -> (f `o` g) `a` x `a` y) (\f g x y -> f `a` x `a` (g `a` y)),- -- (f -.** g) -> f x y (g z)+ -- (f .@@ g) -> f x y (g z) rr0 (\f g x y z -> (f `o2` g) `a` x `a` y `a` z) (\f g x y z -> f `a` x `a` y `a` (g `a` z)), -- x & f -> f x@@ -615,7 +614,7 @@ rr (flipE `a` compE) eyeE, - -- (<&>) -.* (.*) -> (~@~)+ -- (<&>) .@ (.*) -> (~@~) rr (\f g -> (oedipusE `a` eyeE `a` comp2E) `a` f `a` g) (\f g -> needleE `a` f `a` g), @@ -627,7 +626,7 @@ rr (\x -> ampersandE `a` x) (\x -> dollarE `a` x), - -- f -.* (g . f) -> on g f+ -- f .@ (g . f) -> on g f Hard $ rr (\f g -> oedipusE `a` f `a` (compE `a` g `a` f)) (\f g -> onE `a` g `a` f),@@ -696,12 +695,12 @@ rr (\f -> apE `a` f `a` idE) (\f -> joinE `a` f), - -- flip flip f . ((.) .* g) --> f -.** g+ -- flip flip f . ((.) .* g) --> f .@@ g Hard $ rr (\f g -> (flipE `a` flipE `a` f `c` (compE `c2` g))) (\f g -> oedipus2E `a` f `a` g), - -- (. f) . g --> (f -.* g)+ -- (. f) . g --> (f .@ g) Hard $ rr (\f g -> (flipE `a` compE `a` f) `c` g) (\f g -> oedipusE `a` f `a` g),@@ -715,7 +714,7 @@ rr (\p q -> seqME `a` p `a` q) (\p q -> extE `a` (constE `a` q) `a` p), - -- ap (f -.* ((,) . f . fst)) snd --> f (***) f+ -- ap (f .@ ((,) . f . fst)) snd --> f (***) f Hard $ rr (\f -> apE `a` (f `o` (commaE `c` f `c` fstE)) `a` sndE) (\f -> joinE `a` crossE `a` f),@@ -742,7 +741,7 @@ rr (\f g -> flipE `a` flipE `a` idE `c` (apE `c2` (f `c3` g))) (\f g -> mfishE `a` f `a` g), - -- (`ap` snd) . (fst -.* (flip =<< (.) .* ((,) .))) --> join (***)+ -- (`ap` snd) . (fst .@ (flip =<< (.) .* ((,) .))) --> join (***) -- Hard $ rr ((flipE `a` apE `a` sndE) `c` (fstE `o` (extE `a` flipE `a` (compE `c2` (compE `a` commaE))))) (joinE `a` crossE),
src/Plugin/Pl/Transform.hs view
@@ -1,8 +1,6 @@-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE PatternGuards #-}-module Plugin.Pl.Transform (- transform,- ) where+{-# LANGUAGE PatternGuards #-}++module Plugin.Pl.Transform ( transform ) where import Control.Monad.Trans.State import Data.Graph (flattenSCC, flattenSCCs,
test/Test.hs view
@@ -115,15 +115,15 @@ unitTest "fmap . const" ["(<$)"], unitTest "(.) . const" ["(<$)"], -- unitTest "\\x y -> h (f x) y" ["(argument %~ f) h"],- -- unitTest "(mapped.argument %~ f) h x y" ["f -.* h"],+ -- unitTest "(mapped.argument %~ f) h x y" ["f .@ h"], -- unitTest "fmap (<> a)" ["mapping <>= a"], unitTest "and . map f" ["all f"], unitTest "(f =<<) . g" ["f <=< g"], unitTest "or . map f" ["any f"], unitTest "\\x y -> f (x == y)" ["f .* (==)"], unitTest "\\x y z -> f (predicate x y z)" ["f .** predicate"],- unitTest "\\x y -> x == f y" [ "f -.* (==)" ],- unitTest "\\x y z -> predicate x y (f z)" [ "f -.** predicate" ],+ unitTest "\\x y -> x == f y" [ "f .@ (==)" ],+ unitTest "\\x y z -> predicate x y (f z)" [ "f .@@ predicate" ], unitTest "\\x f -> f $ x" [ "(&)" ], unitTest "return ()" ["return ()"], unitTest "f (fix f)" ["fix f"],