prosidyc-0.2.0.0: A DSL for processing Prosidy documents.
Copyright©2020 James Alexander Feldman-Crough
LicenseMPL-2.0
Maintaineralex@fldcr.com
Safe HaskellNone
LanguageHaskell2010

Prosidy.Compile.FromSetting

Description

 
Synopsis

Documentation

class FromSetting a where Source #

A typeclass for parsing Prosidy settings into typed values. A default instance exists for all types implementing Read.

Methods

fromSetting :: Text -> Either String a Source #

Given a Text value containing the setting, either parse a value or return an error message explaining why the value is malformed.

Instances

Instances details
(Typeable a, Read a) => FromSetting a Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

FromSetting Text Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

FromSetting Text Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

FromSetting [Char] Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

(KnownSymbol delim, FromSetting a) => FromSetting (Sep delim a) Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

Methods

fromSetting :: Text -> Either String (Sep delim a) Source #

newtype Sep (delim :: Symbol) a Source #

A newtype wrapper for reading in a delimited list of values. The delim parameter is a type-level string specifying the seperator between values. It must not be empty, or parsing will fail to terminate.

Sep does not handle escaping or other fancy processing.

Constructors

Sep 

Fields

Instances

Instances details
Monad (Sep delim) Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

Methods

(>>=) :: Sep delim a -> (a -> Sep delim b) -> Sep delim b #

(>>) :: Sep delim a -> Sep delim b -> Sep delim b #

return :: a -> Sep delim a #

Functor (Sep delim) Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

Methods

fmap :: (a -> b) -> Sep delim a -> Sep delim b #

(<$) :: a -> Sep delim b -> Sep delim a #

Applicative (Sep delim) Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

Methods

pure :: a -> Sep delim a #

(<*>) :: Sep delim (a -> b) -> Sep delim a -> Sep delim b #

liftA2 :: (a -> b -> c) -> Sep delim a -> Sep delim b -> Sep delim c #

(*>) :: Sep delim a -> Sep delim b -> Sep delim b #

(<*) :: Sep delim a -> Sep delim b -> Sep delim a #

Foldable (Sep delim) Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

Methods

fold :: Monoid m => Sep delim m -> m #

foldMap :: Monoid m => (a -> m) -> Sep delim a -> m #

foldMap' :: Monoid m => (a -> m) -> Sep delim a -> m #

foldr :: (a -> b -> b) -> b -> Sep delim a -> b #

foldr' :: (a -> b -> b) -> b -> Sep delim a -> b #

foldl :: (b -> a -> b) -> b -> Sep delim a -> b #

foldl' :: (b -> a -> b) -> b -> Sep delim a -> b #

foldr1 :: (a -> a -> a) -> Sep delim a -> a #

foldl1 :: (a -> a -> a) -> Sep delim a -> a #

toList :: Sep delim a -> [a] #

null :: Sep delim a -> Bool #

length :: Sep delim a -> Int #

elem :: Eq a => a -> Sep delim a -> Bool #

maximum :: Ord a => Sep delim a -> a #

minimum :: Ord a => Sep delim a -> a #

sum :: Num a => Sep delim a -> a #

product :: Num a => Sep delim a -> a #

Traversable (Sep delim) Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

Methods

traverse :: Applicative f => (a -> f b) -> Sep delim a -> f (Sep delim b) #

sequenceA :: Applicative f => Sep delim (f a) -> f (Sep delim a) #

mapM :: Monad m => (a -> m b) -> Sep delim a -> m (Sep delim b) #

sequence :: Monad m => Sep delim (m a) -> m (Sep delim a) #

Eq a => Eq (Sep delim a) Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

Methods

(==) :: Sep delim a -> Sep delim a -> Bool #

(/=) :: Sep delim a -> Sep delim a -> Bool #

Show a => Show (Sep delim a) Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

Methods

showsPrec :: Int -> Sep delim a -> ShowS #

show :: Sep delim a -> String #

showList :: [Sep delim a] -> ShowS #

Semigroup (Sep delim a) Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

Methods

(<>) :: Sep delim a -> Sep delim a -> Sep delim a #

sconcat :: NonEmpty (Sep delim a) -> Sep delim a #

stimes :: Integral b => b -> Sep delim a -> Sep delim a #

Monoid (Sep delim a) Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

Methods

mempty :: Sep delim a #

mappend :: Sep delim a -> Sep delim a -> Sep delim a #

mconcat :: [Sep delim a] -> Sep delim a #

(KnownSymbol delim, FromSetting a) => FromSetting (Sep delim a) Source # 
Instance details

Defined in Prosidy.Compile.FromSetting

Methods

fromSetting :: Text -> Either String (Sep delim a) Source #