NAME
Data::Object::Utility
ABSTRACT
Data-Object Utility Functions
SYNOPSIS
use Data::Object::Utility;
my $array = Data::Object::Utility::Deduce []; # Data::Object::Array
my $value = Data::Object::Utility::Detract $array; # [,...]
DESCRIPTION
This package provides a suite of utility functions designed to be used internally across core packages.
LIBRARIES
This package uses type constraints defined by:
FUNCTIONS
This package implements the following functions.
deduce
Deduce(Any $arg1) : Any
The Deduce
function returns a data type object instance based upon the deduced type of data provided.
deduceblessed
DeduceBlessed(Any $arg1) : Int
The DeduceBlessed
function returns truthy if the argument is blessed.
deducedeep
DeduceDeep(Any $arg1) : Any
The DeduceDeep
function returns a data type object. If the data provided is complex, this function traverses the data converting all nested data to objects. Note: Blessed objects are not traversed.
deducedefined
DeduceDefined(Any $arg1) : Int
The DeduceDefined
function returns truthy if the argument is defined.
deducenumberlike
DeduceNumberlike(Any $arg1) : Int
The DeduceNumberlike
function returns truthy if the argument is numberlike.
deducereferences
DeduceReferences(Any $arg1) : Int
The DeduceReferences
function returns a data object based on the type of argument reference provided.
deducestringlike
DeduceStringLike(Any $arg1) : Int
The DeduceStringLike
function returns truthy if the argument is stringlike.
detract
Detract(Any $arg1) : Any
The Detract
function returns a value of native type, based upon the underlying reference of the data type object provided.
detractdeep
DetractDeep(Any $arg1) : Any
The DetractDeep
function returns a value of native type. If the data provided is complex, this function traverses the data converting all nested data type objects into native values using the objects underlying reference. Note: Blessed objects are not traversed.
namefile
NameFile(Str $arg1) : Str
The NameFile
function returns the file representation for a given string.
namelabel
NameLabel(Str $arg1) : Str
The NameLabel
function returns the label representation for a given string.
namepackage
NamePackage(Str $arg1) : Str
The NamePackage
function returns the package representation for a give string.
namepath
NamePath(Str $arg1) : Str
The NamePath
function returns the path representation for a given string.
namespace
Namespace(Str $arg1) : Str
The Namespace
function registers a type library with a namespace in the registry so that typed operations know where to look for type context-specific constraints.
registry
Registry() : Object
The Registry
function returns the global Data::Object::Registry object, which holds mappings between namespaces and type registries.
reify
Reify(Str $namespace, Str $expression) : Maybe[Object]
The Reify
function returns a type constraint for a given namespace and expression.
typearray
TypeArray(ArrayRef $arg1) : ArrayObject
The TypeArray
function returns a Data::Object::Array instance which wraps the provided data type and can be used to perform operations on the data.
typecode
TypeCode(CodeRef $arg1) : CodeObject
The TypeCode
function returns a Data::Object::Code instance which wraps the provided data type and can be used to perform operations on the data.
typedata
TypeData(Str $arg1) : Object
The TypeData
function returns a Data::Object::Data instance which parses pod-ish data in files and packages.
typedispatch
TypeDispatch(Str $arg1) : Object
The TypeDispatch
function return a Data::Object::Dispatch object which is a handle that let's you call into other packages.
typeexception
TypeException(Any @args) : Object
The TypeException
function returns a Data::Object::Exception instance which can be thrown.
typefloat
TypeFloat(Str $arg1) : FloatObject
The TypeFloat
function returns a Data::Object::Float instance which wraps the provided data type and can be used to perform operations on the data.
typehash
TypeHash(HashRef $arg1) : HashObject
The TypeHash
function returns a Data::Object::Hash instance which wraps the provided data type and can be used to perform operations on the data.
typename
TypeName(Any $arg1) : Str
The TypeName
function returns a data type description for the type of data provided, represented as a string in capital letters.
typenumber
TypeNumber(Num $arg1) : NumObject
The TypeNumber
function returns a Data::Object::Number instance which wraps the provided data type and can be used to perform operations on the data.
typeregexp
TypeRegexp(RegexpRef $arg1) : RegexpObject
The TypeRegexp
function returns a Data::Object::Regexp instance which wraps the provided data type and can be used to perform operations on the data.
typescalar
TypeScalar(Any $arg1) : ScalarObject
The TypeScalar
function returns a Data::Object::Scalar instance which wraps the provided data type and can be used to perform operations on the data.
typespace
TypeSpace(Str $arg1) : Object
The TypeSpace
function returns a Data::Object::Space instance which provides methods for operating on package and namespaces.
typestring
TypeString(Str $arg1) : StrObject
The TypeString
function returns a Data::Object::String instance which wraps the provided data type and can be used to perform operations on the data.
typeundef
TypeUndef(Undef $arg1) : UndefObject
The TypeUndef
function returns a Data::Object::Undef instance which wraps the provided data type and can be used to perform operations on the data.
CREDITS
Al Newkirk, +319
Anthony Brummett, +10
Adam Hopkins, +2
José Joaquín Atria, +1
AUTHOR
Al Newkirk, awncorp@cpan.org
LICENSE
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated here, https://github.com/iamalnewkirk/do/blob/master/LICENSE.
PROJECT
SEE ALSO
To get the most out of this distribution, consider reading the following: