ParseFromIO

parsley.io$.ParseFromIO
final implicit class ParseFromIO[P, +A](p: P)(implicit con: P => Parsley[A])

This class exposes a method of running parsers from a file.

This extension class operates on values that are convertible to parsers. It enables the use of the parseFromFile method, which can be used to run a parser on the contents of a file.

Type parameters

P

the type of base value that this class is used on (the conversion to Parsley) is summoned automatically.

Value parameters

con

a conversion that allows values convertible to parsers to be used.

p

the value that this class is enabling methods on.

Attributes

Constructor

This constructor should not be called manually, it is designed to be used via Scala's implicit resolution.

Version

3.0.0

Source
io.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def parseFromFile[Err : ErrorBuilder](file: File)(implicit evidence$1: ErrorBuilder[Err], codec: Codec): Try[Result[Err, A]]

This method executes a parser, but collects the input to the parser from the given file.

This method executes a parser, but collects the input to the parser from the given file.

The file name is used to annotate any error messages. The result of this method handles exceptions and ensures the file has been properly closed.

Value parameters

codec

the encoding of the file.

file

the file to load and run against.

Attributes

Returns

a Try containing a result of either a success with a value of type A or a failure with error message on success, and a failure if an IOException occured.

Since

3.0.0

Source
io.scala