-- | The 'ArrowApply' class is equivalent to 'Monad': any monad gives rise
-- to a 'Kleisli' arrow, and any instance of 'ArrowApply' defines a monad.
-newtype ArrowApply a => ArrowMonad a b = ArrowMonad (a () b)
+newtype ArrowMonad a b = ArrowMonad (a () b)
instance ArrowApply a => Monad (ArrowMonad a) where
return x = ArrowMonad (arr (\_ -> x))
-- For a complex number @z@, @'abs' z@ is a number with the magnitude of @z@,
-- but oriented in the positive real direction, whereas @'signum' z@
-- has the phase of @z@, but unit magnitude.
-data (RealFloat a) => Complex a
+data Complex a
= !a :+ !a -- ^ forms a complex number from its real and imaginary
-- rectangular components.
# if __GLASGOW_HASKELL__
-- | The type of immutable non-strict (boxed) arrays
-- with indices in @i@ and elements in @e@.
-data Ix i => Array i e
- = Array !i -- the lower bound, l
- !i -- the upper bound, u
- !Int -- a cache of (rangeSize (l,u))
- -- used to make sure an index is
- -- really in range
- (Array# e) -- The actual elements
+data Array i e
+ = Array !i -- the lower bound, l
+ !i -- the upper bound, u
+ !Int -- a cache of (rangeSize (l,u))
+ -- used to make sure an index is
+ -- really in range
+ (Array# e) -- The actual elements
-- | Mutable, boxed, non-strict arrays in the 'ST' monad. The type
-- arguments are as follows:
\begin{code}
-- | Rational numbers, with numerator and denominator of some 'Integral' type.
-data (Integral a) => Ratio a = !a :% !a deriving (Eq)
+data Ratio a = !a :% !a deriving (Eq)
-- | Arbitrary-precision rational numbers, represented as a ratio of
-- two 'Integer' values. A rational number may be constructed using