Floskell

floskell-0.11.1: A flexible Haskell source code pretty printer

Safe Haskell | None
Language | Haskell2010

Floskell

Contents

- Configuration
- Formatting functions.
- Style
- Testing

Description

Haskell indenter.

Synopsis

- data AppConfig = AppConfig {
  - appStyle :: Style
  - appLanguage :: Language
  - appExtensions :: [Extension]
  - appFixities :: [Fixity]
  }
- defaultAppConfig :: AppConfig
- findAppConfig :: IO (Maybe FilePath)
- findAppConfigIn :: FilePath -> IO (Maybe FilePath)
- readAppConfig :: FilePath -> IO AppConfig
- setStyle :: AppConfig -> Maybe String -> AppConfig
- setLanguage :: AppConfig -> Maybe String -> AppConfig
- setExtensions :: AppConfig -> [String] -> AppConfig
- setFixities :: AppConfig -> [String] -> AppConfig
- reformat :: AppConfig -> Maybe FilePath -> Text -> Either String Text
- data Style = Style {
  - styleName :: !Text
  - styleAuthor :: !Text
  - styleDescription :: !Text
  - styleConfig :: !Config
  }
- styles :: [Style]
- defaultExtensions :: [Extension]

# Configuration

data AppConfig #

Constructors

AppConfig |
Fields appStyle :: Style appLanguage :: Language appExtensions :: [Extension] appFixities :: [Fixity]

#### Instances

Instances details

FromJSON AppConfig # |
Instance details Defined in Floskell.ConfigFile Methods parseJSON :: Value -> Parser AppConfig # parseJSONList :: Value -> Parser [AppConfig] # omittedField :: Maybe AppConfig #
ToJSON AppConfig # |
Instance details Defined in Floskell.ConfigFile Methods toJSON :: AppConfig -> Value # toEncoding :: AppConfig -> Encoding # toJSONList :: [AppConfig] -> Value # toEncodingList :: [AppConfig] -> Encoding # omitField :: AppConfig -> Bool #
Generic AppConfig # |
Instance details Defined in Floskell.ConfigFile Associated Types
type Rep AppConfig |
Instance details Defined in Floskell.ConfigFile type Rep AppConfig = D1 ('MetaData "AppConfig" "Floskell.ConfigFile" "floskell-0.11.1-If3Z75J2neZ5JNi0eSSCAs" 'False) (C1 ('MetaCons "AppConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "appStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Just "appLanguage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Language)) :*: (S1 ('MetaSel ('Just "appExtensions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Extension]) :*: S1 ('MetaSel ('Just "appFixities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Fixity]))))
Methods from :: AppConfig -> Rep AppConfig x # to :: Rep AppConfig x -> AppConfig #
type Rep AppConfig # |
Instance details Defined in Floskell.ConfigFile type Rep AppConfig = D1 ('MetaData "AppConfig" "Floskell.ConfigFile" "floskell-0.11.1-If3Z75J2neZ5JNi0eSSCAs" 'False) (C1 ('MetaCons "AppConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "appStyle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Style) :*: S1 ('MetaSel ('Just "appLanguage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Language)) :*: (S1 ('MetaSel ('Just "appExtensions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Extension]) :*: S1 ('MetaSel ('Just "appFixities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Fixity]))))

defaultAppConfig :: AppConfig #

Default program configuration.

findAppConfig :: IO (Maybe FilePath) #

Try to find a configuration file based on current working directory, or in one of the application configuration directories.

findAppConfigIn :: FilePath -> IO (Maybe FilePath) #

readAppConfig :: FilePath -> IO AppConfig #

Load a configuration file.

setStyle :: AppConfig -> Maybe String -> AppConfig #

setLanguage :: AppConfig -> Maybe String -> AppConfig #

setExtensions :: AppConfig -> [String] -> AppConfig #

setFixities :: AppConfig -> [String] -> AppConfig #

# Formatting functions.

reformat :: AppConfig -> Maybe FilePath -> Text -> Either String Text #

Format the given source.

# Style

data Style #

A printer style.

Constructors

Style |
Fields styleName :: !Text Name of the style, used in the commandline interface. styleAuthor :: !Text Author of the style definition. styleDescription :: !Text Description of the style. styleConfig :: !Config Style definition.

styles :: [Style] #

Styles list, useful for programmatically choosing.

# Testing

defaultExtensions :: [Extension] #

Default extensions.