Copyright | ©2020 James Alexander Feldman-Crough |
---|---|
License | MPL-2.0 |
Maintainer | alex@fldcr.com |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- class FromSetting a where
- fromSetting :: Text -> Either String a
- newtype Sep (delim :: Symbol) a = Sep {
- unsep :: [a]
Documentation
class FromSetting a where Source #
A typeclass for parsing Prosidy settings into typed values. A default
instance exists for all types implementing Read
.
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
(Typeable a, Read a) => FromSetting a Source # | |
Defined in Prosidy.Compile.FromSetting | |
FromSetting Text Source # | |
Defined in Prosidy.Compile.FromSetting | |
FromSetting Text Source # | |
Defined in Prosidy.Compile.FromSetting | |
FromSetting [Char] Source # | |
Defined in Prosidy.Compile.FromSetting | |
(KnownSymbol delim, FromSetting a) => FromSetting (Sep delim a) Source # | |
Defined in Prosidy.Compile.FromSetting |
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.
Instances
Monad (Sep delim) Source # | |
Functor (Sep delim) Source # | |
Applicative (Sep delim) Source # | |
Foldable (Sep delim) Source # | |
Defined in Prosidy.Compile.FromSetting 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] # 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 # | |
Traversable (Sep delim) Source # | |
Defined in Prosidy.Compile.FromSetting | |
Eq a => Eq (Sep delim a) Source # | |
Show a => Show (Sep delim a) Source # | |
Semigroup (Sep delim a) Source # | |
Monoid (Sep delim a) Source # | |
(KnownSymbol delim, FromSetting a) => FromSetting (Sep delim a) Source # | |
Defined in Prosidy.Compile.FromSetting |