Module

Data.Refined

Package
purescript-refined
Repository
danieljharvey/purescript-refined

#Refined Source

newtype Refined p x

Constructors

Instances

#refine Source

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

#unsafeRefine Source

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

#unrefine Source

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

Re-exports from Data.Refined.Error

Re-exports from Data.Refined.Internal

#These Source

data These a b

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

Constructors

Instances

#fromInt Source

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

Re-exports from Data.Refined.Predicate

#ZeroToOne Source

type ZeroToOne = FromTo D0 D1

An inclusive range of values from zero to one.

#To Source

data To n

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

Instances

#SizeLessThan Source

data SizeLessThan a

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

Instances

#SizeGreaterThan Source

data SizeGreaterThan a

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

Instances

#SizeEqualTo Source

data SizeEqualTo a

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

Instances

#Positive Source

type Positive = GreaterThan D0

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

#Or Source

data Or l r

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

Instances

#NotEqualTo Source

data NotEqualTo n

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

Instances

#Not Source

data Not a

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

Instances

#NonZero Source

type NonZero = NotEqualTo D0

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

#NonNegative Source

type NonNegative = From D0

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

#NonEmpty Source

type NonEmpty = SizeGreaterThan D0

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

#Negative Source

type Negative = LessThan D0

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

#LessThan Source

data LessThan n

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

Instances

#IdPred Source

data IdPred

A 'Predicate' for which everything is valid

Instances

#GreaterThan Source

data GreaterThan n

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

Instances

#FromTo Source

data FromTo m n

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

Instances

#From Source

data From n

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

Instances

#EqualTo Source

data EqualTo n

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

Instances

#And Source

data And l r

A 'Predicate' ensuring that both given Predicates are valid

Instances

#Predicate Source

class Predicate p x  where

Members

Instances