hw-polysemy-0.3.1.2: Opinionated polysemy library
Safe HaskellSafe-Inferred
LanguageHaskell2010

HaskellWorks.Polysemy.File

Synopsis

Documentation

data JsonDecodeError #

Instances

Instances details
ToJSON JsonDecodeError 
Instance details

Defined in HaskellWorks.Error.Types.JsonDecodeError

Generic JsonDecodeError 
Instance details

Defined in HaskellWorks.Error.Types.JsonDecodeError

Associated Types

type Rep JsonDecodeError :: Type -> Type #

Show JsonDecodeError 
Instance details

Defined in HaskellWorks.Error.Types.JsonDecodeError

Eq JsonDecodeError 
Instance details

Defined in HaskellWorks.Error.Types.JsonDecodeError

type Rep JsonDecodeError 
Instance details

Defined in HaskellWorks.Error.Types.JsonDecodeError

type Rep JsonDecodeError = D1 ('MetaData "JsonDecodeError" "HaskellWorks.Error.Types.JsonDecodeError" "hw-prelude-0.0.4.2-3LajY09CBNQITcjsxBvCvp" 'False) (C1 ('MetaCons "JsonDecodeError" 'PrefixI 'True) ((S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "bytestring") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ByteString))) :*: (S1 ('MetaSel ('Just "text") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "json") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Value)))))

newtype YamlDecodeError #

Constructors

YamlDecodeError 

Fields

readJsonFile :: forall a r. FromJSON a => HasCallStack => Member (Error IOException) r => Member (Error JsonDecodeError) r => Member (Embed IO) r => Member Log r => FilePath -> Sem r a Source #

Read the filePath file as JSON. Use readJsonFile @Value to decode into Value.

readYamlFile :: forall a r. FromJSON a => HasCallStack => Member (Error IOException) r => Member (Error JsonDecodeError) r => Member (Error YamlDecodeError) r => Member (Embed IO) r => Member Log r => FilePath -> Sem r a Source #

Read the filePath file as YAML.