NewType<NEWTYPE, A> Class

NewType - inspired by Haskell's 'newtype' keyword. https://wiki.haskell.org/Newtype Derive type from this one to get: Equatable, Comparable, Appendable, Subtractable, Multiplicable, Divisible, Foldable, Functor, Interable: strongly typed values.

For example:

class Metres : NewType<Metres, double> { public Metres(double x) : base(x) {} }
class Hours : NewType<Hours, double> { public Hours(double x) : base(x) {} }


Will not accept null values

DECLARATION
[Serializable]
public abstract class NewType<NEWTYPE, A> : NewType<NEWTYPE, A, True<A>>
NAMESPACE
LanguageExt

Constructors

NewType(A)
SUMMARY

Constructor

PARAMETERS
value
A
Value to bind
DECLARATION
public ctor NewType(A value)
EXCEPTIONS
ArgumentNullException
Null values are not accepted