- NewType <NEWTYPE, A>
- NewType <NEWTYPE, A, PRED>
- NewType <NEWTYPE, A, PRED, ORD>
- Value
- New = IL.Ctor<A, NEWTYPE>()
- NewOption (A value)
- NewTry (A value)
- NewType (A value)
- GetObjectData (SerializationInfo info, StreamingContext context)
- CompareTo (NEWTYPE? other)
- Equals (NEWTYPE? other)
- Equals (object? obj)
- GetHashCode ()
- CompareTo (object? obj)
- == (NewType<NEWTYPE, A, PRED, ORD> lhs, NewType<NEWTYPE, A, PRED, ORD> rhs)
- != (NewType<NEWTYPE, A, PRED, ORD> lhs, NewType<NEWTYPE, A, PRED, ORD> rhs)
- > (NewType<NEWTYPE, A, PRED, ORD> lhs, NewType<NEWTYPE, A, PRED, ORD> rhs)
- >= (NewType<NEWTYPE, A, PRED, ORD> lhs, NewType<NEWTYPE, A, PRED, ORD> rhs)
- < (NewType<NEWTYPE, A, PRED, ORD> lhs, NewType<NEWTYPE, A, PRED, ORD> rhs)
- <= (NewType<NEWTYPE, A, PRED, ORD> lhs, NewType<NEWTYPE, A, PRED, ORD> rhs)
- Bind (Func<A, NEWTYPE> bind)
- Exists (Func<A, bool> predicate)
- ForAll (Func<A, bool> predicate)
- Map (Func<A, A> map)
- Select (Func<A, A> map)
- SelectMany ( Func<A, NewType<NEWTYPE, A, PRED, ORD>> bind, Func<A, A, A> project)
- Iter (Action<A> f)
- ToString ()
- Fold <S> (S state, Func<S, A, S> folder)
- FoldBack <S> (S state, Func<S, A, S> folder)
- Prelude
- bind <NEWTYPE, T, PRED> (NewType<NEWTYPE, T, PRED> value, Func<T, NEWTYPE> bind)
- iter <NEWTYPE, T, PRED> (NewType<NEWTYPE, T, PRED> value, Action<T> f)
- exists <NEWTYPE, T, PRED> (NewType<NEWTYPE, T, PRED> value, Func<T, bool> predicate)
- forall <NEWTYPE, T, PRED> (NewType<NEWTYPE, T, PRED> value, Func<T, bool> predicate)
- map <NEWTYPE, T, PRED> (NewType<NEWTYPE, T, PRED> value, Func<T, T> map)
class NewType <NEWTYPE, A> Source #
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
type | NEWTYPE | Implementing class |
type | A | Inner bound value type |
method void GetObjectData (SerializationInfo info, StreamingContext context) Source #
class NewType <NEWTYPE, A, PRED> Source #
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, Monadic, 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
type | NEWTYPE | Implementing class |
type | A | Inner bound value type |
type | PRED | Predicate instance to run when the type is constructed |
method void GetObjectData (SerializationInfo info, StreamingContext context) Source #
class NewType <NEWTYPE, A, PRED, ORD> Source #
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, Monadic, 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
type | NEWTYPE | Implementing class |
type | A | Inner bound value type |
type | PRED | Predicate instance to run when the type is constructed |
type | ORD |
|
field Func<A, NEWTYPE> New = IL.Ctor<A, NEWTYPE>() Source #
Constructor function
method void GetObjectData (SerializationInfo info, StreamingContext context) Source #
method int GetHashCode () Source #
method NEWTYPE Bind (Func<A, NEWTYPE> bind) Source #
Monadic bind of the bound value to a new value of the same type
param | bind | Bind function |
method bool Exists (Func<A, bool> predicate) Source #
Run a predicate for all values in the NewType (only ever one)
method bool ForAll (Func<A, bool> predicate) Source #
Run a predicate for all values in the NewType (only ever one)
method NEWTYPE SelectMany ( Func<A, NewType<NEWTYPE, A, PRED, ORD>> bind, Func<A, A, A> project) Source #
Monadic bind of the bound value to a new value of the same type
param | bind | Bind function |
param | project | Final projection (select) |
method Unit Iter (Action<A> f) Source #
Invoke an action that takes the bound value as an argument
param | f | Action to invoke |
method NEWTYPE bind <NEWTYPE, T, PRED> (NewType<NEWTYPE, T, PRED> value, Func<T, NEWTYPE> bind) Source #
method Unit iter <NEWTYPE, T, PRED> (NewType<NEWTYPE, T, PRED> value, Action<T> f) Source #
method bool exists <NEWTYPE, T, PRED> (NewType<NEWTYPE, T, PRED> value, Func<T, bool> predicate) Source #