ParseableUnit

com.phasmidsoftware.gryphon.parse.Parseable.ParseableUnit
See theParseableUnit companion trait
object ParseableUnit extends ParseableUnit

An implicit object that provides a Parseable implementation for the Unit type. This object enables parsing of strings into Unit values using the Parseable typeclass.

The parse method always returns Some(()) regardless of the input string, since Unit does not encode any meaningful data.

It is commonly used in scenarios where the parsing result itself is irrelevant, and only the fact that parsing occurred successfully matters.

Attributes

Companion
trait
Graph
Supertypes
trait Parseable[Unit]
class Object
trait Matchable
class Any
Self type

Members list

Value members

Inherited methods

def message: String

Returns a constant string representation of the Unit type.

Returns a constant string representation of the Unit type.

Attributes

Returns

the string "Unit"

Inherited from:
ParseableUnit
def none: Unit

Returns a default value of type T.

Returns a default value of type T.

Attributes

Returns

the default value of type T, typically representing an "empty" or "none" state.

Inherited from:
ParseableUnit
def parse(w: String): Try[Unit]

Ignores the given string and returns an Option containing Unit.

Ignores the given string and returns an Option containing Unit.

Value parameters

w

the input string to be parsed (ignored)

Attributes

Returns

an Option containing Unit, which is always Some(())

Inherited from:
ParseableUnit
def regex: Regex

The regular expression used for parsing a Parseable[Unit].

The regular expression used for parsing a Parseable[Unit].

Attributes

Returns

A compiled regular expression. The result matches one or more word characters (()).

Inherited from:
ParseableUnit