LanguageExt.Sys

LanguageExt.Sys Live Implementations

Contents

record ActivitySourceIO (ActivityEnv Env) Source #

Methods

method IO<Activity?> StartActivity (string name, ActivityKind kind) Source #

Creates a new activity if there are active listeners for it, using the specified name and activity kind.

Parameters

param name

The operation name of the activity.

param kind

The activity kind.

returns

The created activity object, if it had active listeners, or None if it has no event listeners.

method IO<Activity?> StartActivity ( string name, ActivityKind kind, ActivityContext parentContext, HashMap<string, object> tags = default, Seq<ActivityLink> links = default, DateTimeOffset startTime = default) Source #

Creates a new activity if there are active listeners for it, using the specified name, activity kind, parent activity context, tags, optional activity link and optional start time.

Parameters

param name

The operation name of the activity.

param kind

The activity kind.

param parentContext

The parent ActivityContext object to initialize the created activity object with

param tags

The optional tags list to initialise the created activity object with.

param links

The optional ActivityLink list to initialise the created activity object with.

param startTime

The optional start timestamp to set on the created activity object.

returns

The created activity object, if it had active listeners, or null if it has no event listeners.

method IO<Activity?> StartActivity ( string name, ActivityKind kind, string parentId, HashMap<string, object> tags = default, Seq<ActivityLink> links = default, DateTimeOffset startTime = default) Source #

Creates a new activity if there are active listeners for it, using the specified name, activity kind, parent activity context, tags, optional activity link and optional start time.

Parameters

param name

The operation name of the activity.

param kind

The activity kind.

param parentId

The parent Id to initialize the created activity object with.

param tags

The optional tags list to initialise the created activity object with.

param links

The optional ActivityLink list to initialise the created activity object with.

param startTime

The optional start timestamp to set on the created activity object.

returns

The created activity object, if it had active listeners, or null if it has no event listeners.

record ConsoleIO Source #

Fields

field Sys.Traits.ConsoleIO Default = new ConsoleIO() Source #

Properties

property IO<ConsoleColor> BgColor Source #

property IO<ConsoleColor> Color Source #

Methods

method IO<Option<ConsoleKeyInfo>> ReadKey () Source #

method IO<Unit> Clear () Source #

method IO<Unit> SetBgColor (ConsoleColor color) Source #

method IO<Unit> SetColor (ConsoleColor color) Source #

method IO<Unit> ResetColor () Source #

method IO<Option<int>> Read () Source #

method IO<Option<string>> ReadLine () Source #

method IO<Unit> WriteLine () Source #

method IO<Unit> WriteLine (string value) Source #

method IO<Unit> Write (string value) Source #

record DirectoryIO Source #

Fields

field Traits.DirectoryIO Default = new DirectoryIO() Source #

Methods

method IO<DirectoryInfo> Create (string path) Source #

method IO<Unit> Delete (string path, bool recursive = true) Source #

method IO<Option<DirectoryInfo>> GetParent (string path) Source #

method IO<bool> Exists (string path) Source #

method IO<Unit> SetCreationTime (string path, DateTime creationTime) Source #

method IO<Unit> SetCreationTimeUtc (string path, DateTime creationTimeUtc) Source #

method IO<DateTime> GetCreationTime (string path) Source #

method IO<DateTime> GetCreationTimeUtc (string path) Source #

method IO<Unit> SetLastWriteTime (string path, DateTime lastWriteTime) Source #

method IO<Unit> SetLastWriteTimeUtc (string path, DateTime lastWriteTimeUtc) Source #

method IO<DateTime> GetLastWriteTime (string path) Source #

method IO<DateTime> GetLastWriteTimeUtc (string path) Source #

method IO<Unit> SetLastAccessTime (string path, DateTime lastAccessTime) Source #

method IO<Unit> SetLastAccessTimeUtc (string path, DateTime lastAccessTimeUtc) Source #

method IO<DateTime> GetLastAccessTime (string path) Source #

method IO<DateTime> GetLastAccessTimeUtc (string path) Source #

method IO<Seq<string>> EnumerateDirectories (string path) Source #

method IO<Seq<string>> EnumerateDirectories (string path, string searchPattern) Source #

method IO<Seq<string>> EnumerateDirectories (string path, string searchPattern, SearchOption searchOption) Source #

method IO<Seq<string>> EnumerateFiles (string path) Source #

method IO<Seq<string>> EnumerateFiles (string path, string searchPattern) Source #

method IO<Seq<string>> EnumerateFiles (string path, string searchPattern, SearchOption searchOption) Source #

method IO<Seq<string>> EnumerateFileSystemEntries (string path) Source #

method IO<Seq<string>> EnumerateFileSystemEntries (string path, string searchPattern) Source #

method IO<Seq<string>> EnumerateFileSystemEntries (string path, string searchPattern, SearchOption searchOption) Source #

method IO<string> GetDirectoryRoot (string path) Source #

method IO<string> GetCurrentDirectory () Source #

method IO<Unit> SetCurrentDirectory (string path) Source #

method IO<Unit> Move (string sourceDirName, string destDirName) Source #

method IO<Seq<string>> GetLogicalDrives () Source #

class EncodingIO Source #

Fields

field Sys.Traits.EncodingIO Default = new EncodingIO() Source #

Properties

property IO<Encoding> Encoding Source #

record EnvironmentIO Source #

Fields

field Sys.Traits.EnvironmentIO Default = new EnvironmentIO() Source #

Methods

method IO<string> CommandLine () Source #

Gets the command line for this process.

method IO<Unit> SetCurrentDirectory (string directory) Source #

Sets the fully qualified path of the current working directory.

method IO<int> CurrentManagedThreadId () Source #

Gets a unique identifier for the current managed thread.

method IO<Unit> Exit (int exitCode) Source #

Terminates this process and returns an exit code to the operating

method IO<int> ExitCode () Source #

Gets the exit code of the process.

method IO<Unit> SetExitCode (int exitCode) Source #

Sets the exit code of the process.

method IO<string> ExpandEnvironmentVariables (string name) Source #

Replaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, then returns the resulting string.

method IO<Unit> FailFast (Option<string> message) Source #

Immediately terminates a process after writing a message to the Windows Application event log, and then includes the message in error reporting to Microsoft.

method IO<Unit> FailFast (Option<string> message, Option<Exception> exception) Source #

Immediately terminates a process after writing a message to the Windows Application event log, and then includes the message and exception information in error reporting to Microsoft.

method IO<Seq<string>> GetCommandLineArgs () Source #

Returns a string array containing the command-line arguments for the current process.

method IO<Option<string>> GetEnvironmentVariable (string variable) Source #

Retrieves the value of an environment variable from the current process.

method IO<Option<string>> GetEnvironmentVariable (string variable, EnvironmentVariableTarget target) Source #

Retrieves the value of an environment variable from the current process or from the Windows operating system registry key for the current user or local machine.

method IO<HashMap<string, Option<string>>> GetEnvironmentVariables () Source #

Retrieves all environment variable names and their values from the current process.

method IO<HashMap<string, Option<string>>> GetEnvironmentVariables (EnvironmentVariableTarget target) Source #

Retrieves all environment variable names and their values from the current process, or from the Windows operating system registry key for the current user or local machine.

method IO<string> GetFolderPath (Environment.SpecialFolder folder) Source #

Gets the path to the system special folder that is identified by the specified enumeration.

method IO<string> GetFolderPath (Environment.SpecialFolder folder, Environment.SpecialFolderOption option) Source #

Gets the path to the system special folder that is identified by the specified enumeration, and uses a specified option for accessing special folders.

method IO<Seq<string>> GetLogicalDrives () Source #

Returns an array of string containing the names of the logical drives on the current computer.

method IO<bool> HasShutdownStarted () Source #

Gets a value that indicates whether the current application domain is being unloaded or the common language runtime (CLR) is shutting down.

method IO<bool> Is64BitOperatingSystem () Source #

Determines whether the current operating system is a 64-bit operating

method IO<bool> Is64BitProcess () Source #

Determines whether the current process is a 64-bit process.

method IO<string> MachineName () Source #

Gets the NetBIOS name of this local computer.

method IO<string> NewLine () Source #

Gets the newline string defined for this environment.

method IO<OperatingSystem> OSVersion () Source #

Gets an OperatingSystem object that contains the current platform identifier and version number.

method IO<int> ProcessorCount () Source #

Gets the number of processors on the current machine.

method IO<Unit> SetEnvironmentVariable (string variable, Option<string> value) Source #

Creates, modifies, or deletes an environment variable stored in the current process.

method IO<Unit> SetEnvironmentVariable (string variable, Option<string> value, EnvironmentVariableTarget target) Source #

Creates, modifies, or deletes an environment variable stored in the current process or in the Windows operating system registry key reserved for the current user or local machine.

method IO<string> StackTrace () Source #

Gets current stack trace information.

method IO<string> SystemDirectory () Source #

Gets the fully qualified path of the system directory.

method IO<int> SystemPageSize () Source #

Gets the number of bytes in the operating system's memory page.

method IO<long> TickCount () Source #

Gets the number of milliseconds elapsed since the system started.

method IO<string> UserDomainName () Source #

Gets the network domain name associated with the current user.

method IO<bool> UserInteractive () Source #

Gets a value indicating whether the current process is running in user interactive mode.

method IO<string> UserName () Source #

Gets the user name of the person who is currently logged on to the operating

method IO<Version> Version () Source #

Gets a Version object that describes the major, minor, build, and revision numbers of the common language runtime.

method IO<long> WorkingSet () Source #

Gets the amount of physical memory mapped to the process context.

record FileIO Source #

Real world interaction with the file-system

Fields

field Sys.Traits.FileIO Default = new FileIO() Source #

Methods

method IO<Unit> Copy (string fromPath, string toPath, bool overwrite = false) Source #

Copy file from one place to another

method IO<Unit> Move (string fromPath, string toPath) Source #

Move file from one place to another

method IO<Unit> Move (string fromPath, string toPath, bool overwrite) Source #

Move file from one place to another

method IO<Unit> AppendAllLines (string path, IEnumerable<string> lines, Encoding encoding) Source #

Append lines to the end of a file

method IO<Seq<string>> ReadAllLines (string path, Encoding encoding) Source #

Read all lines from a file

method IO<Unit> WriteAllLines (string path, IEnumerable<string> lines, Encoding encoding) Source #

Write all lines to a file

method IO<string> ReadAllText (string path, Encoding encoding) Source #

Read text from a file

method IO<byte[]> ReadAllBytes (string path) Source #

Read data from a file

method IO<Unit> WriteAllText (string path, string text, Encoding encoding) Source #

Write text to a file

method IO<Unit> WriteAllBytes (string path, byte[] data) Source #

Write data to a file

method IO<Unit> Delete (string path) Source #

Delete a file

method IO<bool> Exists (string path) Source #

True if a file at the path exists

method IO<TextReader> OpenText (string path) Source #

Open a text file

method IO<TextWriter> CreateText (string path) Source #

Create a new text file to stream to

method IO<TextWriter> AppendText (string path) Source #

Return a stream to append text to

method IO<Stream> OpenRead (string path) Source #

Open a file-stream

method IO<Stream> Open (string path, FileMode mode) Source #

Open a file-stream

method IO<Stream> Open (string path, FileMode mode, FileAccess access) Source #

Open a file-stream

method IO<Stream> OpenWrite (string path) Source #

Open a file-stream

record TextReadIO Source #

Fields

field Sys.Traits.TextReadIO Default = new TextReadIO() Source #

Methods

method IO<Option<string>> ReadLine (TextReader reader) Source #

Read a line of text from the stream

method IO<string> ReadToEnd (TextReader reader) Source #

Read the rest of the text in the stream

method IO<int> Read (TextReader reader, Memory<char> buffer) Source #

Read chars from the stream into the buffer Returns the number of chars read

method IO<Unit> Close (TextReader reader) Source #

Close the reader

struct TimeIO Source #

Fields

field Sys.Traits.TimeIO Default = new TimeIO() Source #

Properties

property IO<DateTime> Now Source #

Current date time

property IO<DateTime> UtcNow Source #

Current date time

property IO<DateTime> Today Source #

Today's date

Methods

method IO<Unit> SleepUntil (DateTime dt) Source #

Pause a task until a specified time

method IO<Unit> SleepFor (TimeSpan ts) Source #

Pause a task until for a specified length of time