Module

Data.Refined

#Refined

newtype Refined p x

Constructors

Instances

#refine

refine :: forall p x. Predicate p x => x -> Either (RefinedError x) (Refined p x)

#unsafeRefine

unsafeRefine :: forall p x. Predicate p x => x -> (Refined p x)

#unrefine

unrefine :: forall p x. Refined p x -> x

Re-exports from Data.Refined.Error

Re-exports from Data.Refined.Internal

#These

data These a b

Helper version of function because i am too lazy to find the package

Constructors

Instances

#fromInt

fromInt :: forall a. Ring a => Int -> a

Re-exports from Data.Refined.Predicate

#ZeroToOne

type ZeroToOne = FromTo D0 D1

An inclusive range of values from zero to one.

#To

data To n

A 'Predicate' ensuring that the value is up and including a given int

Instances

#SizeLessThan

data SizeLessThan a

A 'Predicate' ensuring that the length of a foldable is less than a given int

Instances

#SizeGreaterThan

data SizeGreaterThan a

A 'Predicate' ensuring that the length of a foldable is greater than a given int

Instances

#SizeEqualTo

data SizeEqualTo a

A 'Predicate' ensuring that the length of a foldable is equal to a given int

Instances

#Positive

type Positive = GreaterThan D0

A 'Predicate' ensuring that the value is greater than zero.

#Or

data Or l r

A 'Predicate' ensuring that one of two given Predicates is valid

Instances

#NotEqualTo

data NotEqualTo n

A 'Predicate' ensuring that the value is not equal to a given int

Instances

#Not

data Not a

A 'Predicate' ensuring that the opposite of another Predicate passes

Instances

#NonZero

type NonZero = NotEqualTo D0

A 'Predicate' ensuring that the value is not equal to zero.

#NonNegative

type NonNegative = From D0

A 'Predicate' ensuring that the value is greater than or equal to zero.

#NonEmpty

type NonEmpty = SizeGreaterThan D0

A 'Predicate' ensuring that the 'Foldable' is non-empty.

#Negative

type Negative = LessThan D0

A 'Predicate' ensuring that the value is less than zero.

#LessThan

data LessThan n

A 'Predicate' ensuring that the value is less than a given int

Instances

#IdPred

data IdPred

A 'Predicate' for which everything is valid

Instances

#GreaterThan

data GreaterThan n

A 'Predicate' ensuring that the value is greater than a given int

Instances

#FromTo

data FromTo m n

A 'Predicate' ensuring that the value is between two given ints (inclusive)

Instances

#From

data From n

A 'Predicate' ensuring that the value is equal to or greater than a given int

Instances

#EqualTo

data EqualTo n

A 'Predicate' ensuring that the value is equal to a given int

Instances

#And

data And l r

A 'Predicate' ensuring that both given Predicates are valid

Instances

#Predicate

class Predicate p x  where

Members

Instances

Modules