ruff-0.4: relatively useful fractal functions

Copyright(c) Claude Heiland-Allen 2015
LicenseBSD3
Maintainerclaude@mathr.co.uk
Stabilityunstable
PortabilityTypeFamilies
Safe HaskellSafe-Inferred
LanguageHaskell98

Fractal.RUFF.Types.Ratio

Description

Rational numbers with ruff-specific operations.

Synopsis

Documentation

class Q r where Source

Rational numbers with ruff-specific operations.

Minimal complete definition

(%), numerator, denominator

Associated Types

type Z r Source

Methods

(%) :: Z r -> Z r -> r infixl 7 Source

smart constuctor

numerator :: r -> Z r Source

extract numerator

denominator :: r -> Z r Source

extract denominator

(%!) :: Z r -> Z r -> r infixl 7 Source

unsafe constructor

zero :: Integral (Z r) => r Source

0

half :: Integral (Z r) => r Source

1/2

one :: Integral (Z r) => r Source

1

fromQ :: Integral (Z r) => r -> Rational Source

convert to Prelude.Rational

toQ :: Integral (Z r) => Rational -> r Source

convert from Prelude.Rational

wrap :: Integral (Z r) => r -> r Source

wrap into [0,1)

doubleWrap :: Integral (Z r) => r -> r Source

doubling map to [0,1)

double :: Integral (Z r) => r -> r Source

doubling map from [0,1) to [0,1)

doubleOdd :: Integral (Z r) => r -> r Source

doubling map from [0,1) to [0,1) for odd denominator

preimages :: Integral (Z r) => r -> (r, r) Source

doubling map preimages from [0,1) to [0,1)x[0,1)

Instances

Integral a => Q (Ratio a) 
Integral a => Q (Ratio a) 

data Ratio a Source

Ratio data structure

Constructors

!a :% !a 

Instances

Eq a => Eq (Ratio a) 
Data a => Data (Ratio a) 
Integral a => Ord (Ratio a) 
(Integral a, Read a) => Read (Ratio a) 
(Integral a, Show a) => Show (Ratio a) 
Integral a => Q (Ratio a) 
Typeable (* -> *) Ratio 
type Z (Ratio a) = a 

type Rational = Ratio Integer Source

Rational type