-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Helper functions for working with haskell-src-exts trees
--   
--   Helper functions for working with haskell-src-exts trees.
@package haskell-src-exts-util
@version 0.2.5

module Language.Haskell.Exts.Util
class FreeVars a

-- | Return the variables, erring on the side of more free variables
freeVars :: FreeVars a => a -> Set (Name ())
data Vars
Vars :: Set (Name ()) -> Set (Name ()) -> Vars
[bound] :: Vars -> Set (Name ())
[free] :: Vars -> Set (Name ())
class AllVars a

-- | Return the variables, erring on the side of more free variables
allVars :: AllVars a => a -> Vars
class Brackets a
remParen :: Brackets a => a -> Maybe a
addParen :: Brackets a => a -> a

-- | Is this item lexically requiring no bracketing ever i.e. is totally
--   atomic
isAtom :: Brackets a => a -> Bool

-- | Is the child safe free from brackets in the parent position. Err on
--   the side of caution, True = don't know
needBracket :: Brackets a => Int -> a -> a -> Bool

-- | Add a Paren around something if it is not atomic
paren :: (Data l, Default l) => Exp l -> Exp l
transformBracket :: (Data l, Default l) => (Exp l -> Maybe (Exp l)) -> Exp l -> Exp l

-- | Add/remove brackets as suggested needBracket at 1-level of depth
rebracket1 :: (Data l, Default l) => Exp l -> Exp l
appsBracket :: (Data l, Default l) => [Exp l] -> Exp l
instance Data.Default.Internal.Default Language.Haskell.Exts.SrcLoc.SrcLoc
instance Data.Default.Internal.Default Language.Haskell.Exts.SrcLoc.SrcSpan
instance Data.Default.Internal.Default Language.Haskell.Exts.SrcLoc.SrcSpanInfo
