package erasure

import "github.com/IBM/fp-go/erasure"

Index

Functions

func Erase

func Erase[T any](t T) any

Erase converts a variable of type T to an any by returning a pointer to that variable

func Erase0

func Erase0[T1 any](f func() T1) func() any

Erase0 converts a type safe function into an erased function

func Erase1

func Erase1[T1, T2 any](f func(T1) T2) func(any) any

Erase1 converts a type safe function into an erased function

func Erase2

func Erase2[T1, T2, T3 any](f func(T1, T2) T3) func(any, any) any

Erase2 converts a type safe function into an erased function

func SafeUnerase

func SafeUnerase[T any](t any) E.Either[error, T]

SafeUnerase converts an erased variable back to its original value

func Unerase

func Unerase[T any](t any) T

Unerase converts an erased variable back to its original value

Source Files

erasure.go

Version
v1.0.151 (latest)
Published
Nov 23, 2024
Platform
linux/amd64
Imports
3 packages
Last checked
5 months ago

Tools for package owners.