hasktorch-types-th-0.0.1.0: C-types for Torch

Copyright(c) Sam Stites 2017
LicenseBSD3
Maintainersam@stites.io
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe
LanguageHaskell2010

Torch.Types.Numeric

Description

ADTs to manage runtime boundaries

Synopsis

Documentation

data OpenUnit x Source #

Datatype to represent the open unit interval: 0 < x < 1. Any OpenUnit inhabitant must satisfy being in the interval.

FIXME: replace with numhask.

Instances
Eq x => Eq (OpenUnit x) Source # 
Instance details

Defined in Torch.Types.Numeric

Methods

(==) :: OpenUnit x -> OpenUnit x -> Bool #

(/=) :: OpenUnit x -> OpenUnit x -> Bool #

Ord x => Ord (OpenUnit x) Source # 
Instance details

Defined in Torch.Types.Numeric

Methods

compare :: OpenUnit x -> OpenUnit x -> Ordering #

(<) :: OpenUnit x -> OpenUnit x -> Bool #

(<=) :: OpenUnit x -> OpenUnit x -> Bool #

(>) :: OpenUnit x -> OpenUnit x -> Bool #

(>=) :: OpenUnit x -> OpenUnit x -> Bool #

max :: OpenUnit x -> OpenUnit x -> OpenUnit x #

min :: OpenUnit x -> OpenUnit x -> OpenUnit x #

Show x => Show (OpenUnit x) Source # 
Instance details

Defined in Torch.Types.Numeric

Methods

showsPrec :: Int -> OpenUnit x -> ShowS #

show :: OpenUnit x -> String #

showList :: [OpenUnit x] -> ShowS #

openUnit :: (Ord x, Num x) => x -> Maybe (OpenUnit x) Source #

smart constructor to place a number in the open unit interval.

openUnitValue :: OpenUnit x -> x Source #

Get a value from the open unit interval.

data ClosedUnit x Source #

Datatype to represent the closed unit interval: 0 =< x =< 1. Any ClosedUnit inhabitant must satisfy being in the interval.

FIXME: replace with numhask.

Instances
Eq x => Eq (ClosedUnit x) Source # 
Instance details

Defined in Torch.Types.Numeric

Methods

(==) :: ClosedUnit x -> ClosedUnit x -> Bool #

(/=) :: ClosedUnit x -> ClosedUnit x -> Bool #

Ord x => Ord (ClosedUnit x) Source # 
Instance details

Defined in Torch.Types.Numeric

Show x => Show (ClosedUnit x) Source # 
Instance details

Defined in Torch.Types.Numeric

closedUnit :: (Ord x, Num x) => x -> Maybe (ClosedUnit x) Source #

smart constructor to place a number in the closed unit interval.

closedUnitValue :: ClosedUnit x -> x Source #

Get a value from the closed unit interval.

data Ord2Tuple x Source #

Datatype to represent an ordered pair of numbers, (a, b), where a <= b.

FIXME: replace with numhask.

Instances
Eq x => Eq (Ord2Tuple x) Source # 
Instance details

Defined in Torch.Types.Numeric

Methods

(==) :: Ord2Tuple x -> Ord2Tuple x -> Bool #

(/=) :: Ord2Tuple x -> Ord2Tuple x -> Bool #

Show x => Show (Ord2Tuple x) Source # 
Instance details

Defined in Torch.Types.Numeric

ord2Tuple :: (Ord x, Num x) => (x, x) -> Maybe (Ord2Tuple x) Source #

smart constructor to place two values in an ordered tuple.

ord2TupleValue :: Ord2Tuple x -> (x, x) Source #

Get the values of an ordered tuple.

data Positive x Source #

Datatype to represent a generic positive number: 0 =< x.

FIXME: replace with numhask.

Instances
Eq x => Eq (Positive x) Source # 
Instance details

Defined in Torch.Types.Numeric

Methods

(==) :: Positive x -> Positive x -> Bool #

(/=) :: Positive x -> Positive x -> Bool #

Ord x => Ord (Positive x) Source # 
Instance details

Defined in Torch.Types.Numeric

Methods

compare :: Positive x -> Positive x -> Ordering #

(<) :: Positive x -> Positive x -> Bool #

(<=) :: Positive x -> Positive x -> Bool #

(>) :: Positive x -> Positive x -> Bool #

(>=) :: Positive x -> Positive x -> Bool #

max :: Positive x -> Positive x -> Positive x #

min :: Positive x -> Positive x -> Positive x #

Show x => Show (Positive x) Source # 
Instance details

Defined in Torch.Types.Numeric

Methods

showsPrec :: Int -> Positive x -> ShowS #

show :: Positive x -> String #

showList :: [Positive x] -> ShowS #

positive :: (Ord x, Num x) => x -> Maybe (Positive x) Source #

smart constructor to place a number in a positive bound.

positiveValue :: Positive x -> x Source #

Get a value from the positive bound.

data NonZero x Source #

Datatype to represent a number that is not zero: 0 /= x.

FIXME: replace with numhask.

Instances
Eq x => Eq (NonZero x) Source # 
Instance details

Defined in Torch.Types.Numeric

Methods

(==) :: NonZero x -> NonZero x -> Bool #

(/=) :: NonZero x -> NonZero x -> Bool #

Ord x => Ord (NonZero x) Source # 
Instance details

Defined in Torch.Types.Numeric

Methods

compare :: NonZero x -> NonZero x -> Ordering #

(<) :: NonZero x -> NonZero x -> Bool #

(<=) :: NonZero x -> NonZero x -> Bool #

(>) :: NonZero x -> NonZero x -> Bool #

(>=) :: NonZero x -> NonZero x -> Bool #

max :: NonZero x -> NonZero x -> NonZero x #

min :: NonZero x -> NonZero x -> NonZero x #

Show x => Show (NonZero x) Source # 
Instance details

Defined in Torch.Types.Numeric

Methods

showsPrec :: Int -> NonZero x -> ShowS #

show :: NonZero x -> String #

showList :: [NonZero x] -> ShowS #

nonZero :: (Ord x, Num x) => x -> Maybe (NonZero x) Source #

smart constructor to place a number in a positive bound.

nonZeroValue :: NonZero x -> x Source #

Get a value from the positive bound.