{-# LANGUAGE
OverloadedStrings
, GeneralizedNewtypeDeriving
, FlexibleInstances
, ExistentialQuantification
, StandaloneDeriving
, TypeFamilies
, EmptyDataDecls
#-}
module Clay.Size
(
Size
, LengthUnit
, Percentage
, nil
, unitless
, cm
, mm
, inches
, px
, pt
, pc
, em
, ex
, pct
, rem
, vw
, vh
, vmin
, vmax
, fr
, maxContent
, minContent
, available
, fitContent
, (@+@)
, (@-@)
, (@*)
, (*@)
, (@/)
, sym
, sym2
, sym3
, Angle
, Deg
, Rad
, Grad
, Turn
, deg
, rad
, grad
, turn
)
where
import Data.Monoid
import Prelude hiding (rem)
import Data.Text (Text)
import Clay.Common
import Clay.Property
import Clay.Stylesheet
data LengthUnit
data Percentage
data Combination
data Size a =
SimpleSize Text |
forall b c. SumSize (Size b) (Size c) |
forall b c. DiffSize (Size b) (Size c) |
MultSize Double (Size a) |
DivSize Double (Size a) |
OtherSize Value
deriving instance Show (Size a)
sizeToText :: Size a -> Text
sizeToText :: Size a -> Text
sizeToText (SimpleSize Text
txt) = Text
txt
sizeToText (SumSize Size b
a Size c
b) = [Text] -> Text
forall a. Monoid a => [a] -> a
mconcat [Text
"(", Size b -> Text
forall a. Size a -> Text
sizeToText Size b
a, Text
" + ", Size c -> Text
forall a. Size a -> Text
sizeToText Size c
b, Text
")"]
sizeToText (DiffSize Size b
a Size c
b) = [Text] -> Text
forall a. Monoid a => [a] -> a
mconcat [Text
"(", Size b -> Text
forall a. Size a -> Text
sizeToText Size b
a, Text
" - ", Size c -> Text
forall a. Size a -> Text
sizeToText Size c
b, Text
")"]
sizeToText (MultSize Double
a Size a
b) = [Text] -> Text
forall a. Monoid a => [a] -> a
mconcat [Text
"(", Double -> Text
cssDoubleText Double
a, Text
" * ", Size a -> Text
forall a. Size a -> Text
sizeToText Size a
b, Text
")"]
sizeToText (DivSize Double
a Size a
b) = [Text] -> Text
forall a. Monoid a => [a] -> a
mconcat [Text
"(", Size a -> Text
forall a. Size a -> Text
sizeToText Size a
b, Text
" / ", Double -> Text
cssDoubleText Double
a, Text
")"]
sizeToText (OtherSize Value
a) = Prefixed -> Text
plain (Prefixed -> Text) -> Prefixed -> Text
forall a b. (a -> b) -> a -> b
$ Value -> Prefixed
unValue Value
a
instance Val (Size a) where
value :: Size a -> Value
value (SimpleSize Text
a) = Text -> Value
forall a. Val a => a -> Value
value Text
a
value (OtherSize Value
a) = Value
a
value Size a
s = Prefixed -> Value
Value (Prefixed -> Value) -> Prefixed -> Value
forall a b. (a -> b) -> a -> b
$ Prefixed
browsers Prefixed -> Prefixed -> Prefixed
forall a. Semigroup a => a -> a -> a
<> Text -> Prefixed
Plain (Text
"calc" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Size a -> Text
forall a. Size a -> Text
sizeToText Size a
s)
instance Auto (Size a) where auto :: Size a
auto = Value -> Size a
forall a. Value -> Size a
OtherSize Value
Clay.Common.autoValue
instance Normal (Size a) where normal :: Size a
normal = Value -> Size a
forall a. Value -> Size a
OtherSize Value
Clay.Common.normalValue
instance Inherit (Size a) where inherit :: Size a
inherit = Value -> Size a
forall a. Value -> Size a
OtherSize Value
Clay.Common.inheritValue
instance None (Size a) where none :: Size a
none = Value -> Size a
forall a. Value -> Size a
OtherSize Value
Clay.Common.noneValue
instance Other (Size a) where other :: Value -> Size a
other Value
a = Value -> Size a
forall a. Value -> Size a
OtherSize Value
a
nil :: Size a
nil :: Size a
nil = Text -> Size a
forall a. Text -> Size a
SimpleSize Text
"0"
unitless :: Double -> Size a
unitless :: Double -> Size a
unitless Double
i = Text -> Size a
forall a. Text -> Size a
SimpleSize ((Prefixed -> Text
plain (Prefixed -> Text) -> (Double -> Prefixed) -> Double -> Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Value -> Prefixed
unValue (Value -> Prefixed) -> (Double -> Value) -> Double -> Prefixed
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Double -> Value
forall a. Val a => a -> Value
value) Double
i)
cm, mm, inches, px, pt, pc :: Double -> Size LengthUnit
cm :: Double -> Size LengthUnit
cm Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"cm")
mm :: Double -> Size LengthUnit
mm Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"mm")
inches :: Double -> Size LengthUnit
inches Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"in")
px :: Double -> Size LengthUnit
px Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"px")
pt :: Double -> Size LengthUnit
pt Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"pt")
pc :: Double -> Size LengthUnit
pc Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"pc")
em, ex, rem, vw, vh, vmin, vmax, fr :: Double -> Size LengthUnit
em :: Double -> Size LengthUnit
em Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"em")
ex :: Double -> Size LengthUnit
ex Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"ex")
rem :: Double -> Size LengthUnit
rem Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"rem")
vw :: Double -> Size LengthUnit
vw Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"vw")
vh :: Double -> Size LengthUnit
vh Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"vh")
vmin :: Double -> Size LengthUnit
vmin Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"vmin")
vmax :: Double -> Size LengthUnit
vmax Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"vmax")
fr :: Double -> Size LengthUnit
fr Double
i = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"fr")
maxContent :: Size LengthUnit
maxContent :: Size LengthUnit
maxContent = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize Text
"max-content"
minContent :: Size LengthUnit
minContent :: Size LengthUnit
minContent = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize Text
"min-content"
available :: Size LengthUnit
available :: Size LengthUnit
available = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize Text
"available"
fitContent :: Size LengthUnit
fitContent :: Size LengthUnit
fitContent = Text -> Size LengthUnit
forall a. Text -> Size a
SimpleSize Text
"fit-content"
pct :: Double -> Size Percentage
pct :: Double -> Size Percentage
pct Double
i = Text -> Size Percentage
forall a. Text -> Size a
SimpleSize (Double -> Text
cssDoubleText Double
i Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"%")
instance Num (Size LengthUnit) where
fromInteger :: Integer -> Size LengthUnit
fromInteger = Double -> Size LengthUnit
px (Double -> Size LengthUnit)
-> (Integer -> Double) -> Integer -> Size LengthUnit
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Double
forall a. Num a => Integer -> a
fromInteger
+ :: Size LengthUnit -> Size LengthUnit -> Size LengthUnit
(+) = String -> Size LengthUnit -> Size LengthUnit -> Size LengthUnit
forall a. HasCallStack => String -> a
error String
"plus not implemented for Size"
* :: Size LengthUnit -> Size LengthUnit -> Size LengthUnit
(*) = String -> Size LengthUnit -> Size LengthUnit -> Size LengthUnit
forall a. HasCallStack => String -> a
error String
"times not implemented for Size"
abs :: Size LengthUnit -> Size LengthUnit
abs = String -> Size LengthUnit -> Size LengthUnit
forall a. HasCallStack => String -> a
error String
"abs not implemented for Size"
signum :: Size LengthUnit -> Size LengthUnit
signum = String -> Size LengthUnit -> Size LengthUnit
forall a. HasCallStack => String -> a
error String
"signum not implemented for Size"
negate :: Size LengthUnit -> Size LengthUnit
negate = String -> Size LengthUnit -> Size LengthUnit
forall a. HasCallStack => String -> a
error String
"negate not implemented for Size"
instance Fractional (Size LengthUnit) where
fromRational :: Rational -> Size LengthUnit
fromRational = Double -> Size LengthUnit
px (Double -> Size LengthUnit)
-> (Rational -> Double) -> Rational -> Size LengthUnit
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Rational -> Double
forall a. Fractional a => Rational -> a
fromRational
recip :: Size LengthUnit -> Size LengthUnit
recip = String -> Size LengthUnit -> Size LengthUnit
forall a. HasCallStack => String -> a
error String
"recip not implemented for Size"
instance Num (Size Percentage) where
fromInteger :: Integer -> Size Percentage
fromInteger = Double -> Size Percentage
pct (Double -> Size Percentage)
-> (Integer -> Double) -> Integer -> Size Percentage
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Double
forall a. Num a => Integer -> a
fromInteger
+ :: Size Percentage -> Size Percentage -> Size Percentage
(+) = String -> Size Percentage -> Size Percentage -> Size Percentage
forall a. HasCallStack => String -> a
error String
"plus not implemented for Size"
* :: Size Percentage -> Size Percentage -> Size Percentage
(*) = String -> Size Percentage -> Size Percentage -> Size Percentage
forall a. HasCallStack => String -> a
error String
"times not implemented for Size"
abs :: Size Percentage -> Size Percentage
abs = String -> Size Percentage -> Size Percentage
forall a. HasCallStack => String -> a
error String
"abs not implemented for Size"
signum :: Size Percentage -> Size Percentage
signum = String -> Size Percentage -> Size Percentage
forall a. HasCallStack => String -> a
error String
"signum not implemented for Size"
negate :: Size Percentage -> Size Percentage
negate = String -> Size Percentage -> Size Percentage
forall a. HasCallStack => String -> a
error String
"negate not implemented for Size"
instance Fractional (Size Percentage) where
fromRational :: Rational -> Size Percentage
fromRational = Double -> Size Percentage
pct (Double -> Size Percentage)
-> (Rational -> Double) -> Rational -> Size Percentage
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Rational -> Double
forall a. Fractional a => Rational -> a
fromRational
recip :: Size Percentage -> Size Percentage
recip = String -> Size Percentage -> Size Percentage
forall a. HasCallStack => String -> a
error String
"recip not implemented for Size"
type family SizeCombination sa sb where
SizeCombination Percentage Percentage = Percentage
SizeCombination LengthUnit LengthUnit = LengthUnit
SizeCombination a b = Combination
infixl 6 @+@
(@+@) :: Size a -> Size b -> Size (SizeCombination a b)
Size a
a @+@ :: Size a -> Size b -> Size (SizeCombination a b)
@+@ Size b
b = Size a -> Size b -> Size (SizeCombination a b)
forall a b c. Size b -> Size c -> Size a
SumSize Size a
a Size b
b
infixl 6 @-@
(@-@) :: Size a -> Size b -> Size (SizeCombination a b)
Size a
a @-@ :: Size a -> Size b -> Size (SizeCombination a b)
@-@ Size b
b = Size a -> Size b -> Size (SizeCombination a b)
forall a b c. Size b -> Size c -> Size a
DiffSize Size a
a Size b
b
infixl 7 *@
(*@) :: Double -> Size a -> Size a
Double
a *@ :: Double -> Size a -> Size a
*@ Size a
b = Double -> Size a -> Size a
forall a. Double -> Size a -> Size a
MultSize Double
a Size a
b
infixl 7 @*
(@*) :: Size a -> Double -> Size a
Size a
a @* :: Size a -> Double -> Size a
@* Double
b = Double -> Size a -> Size a
forall a. Double -> Size a -> Size a
MultSize Double
b Size a
a
infixl 7 @/
(@/) :: Size a -> Double -> Size a
Size a
a @/ :: Size a -> Double -> Size a
@/ Double
b = Double -> Size a -> Size a
forall a. Double -> Size a -> Size a
DivSize Double
b Size a
a
sym :: (a -> a -> a -> a -> Css) -> a -> Css
sym :: (a -> a -> a -> a -> Css) -> a -> Css
sym a -> a -> a -> a -> Css
k a
a = a -> a -> a -> a -> Css
k a
a a
a a
a a
a
sym3 :: (tb -> l -> tb -> r -> Css) -> tb -> l -> r -> Css
sym3 :: (tb -> l -> tb -> r -> Css) -> tb -> l -> r -> Css
sym3 tb -> l -> tb -> r -> Css
k tb
tb l
l r
r = tb -> l -> tb -> r -> Css
k tb
tb l
l tb
tb r
r
sym2 :: (tb -> lr -> tb -> lr -> Css) -> tb -> lr -> Css
sym2 :: (tb -> lr -> tb -> lr -> Css) -> tb -> lr -> Css
sym2 tb -> lr -> tb -> lr -> Css
k tb
tb lr
lr = tb -> lr -> tb -> lr -> Css
k tb
tb lr
lr tb
tb lr
lr
data Deg
data Rad
data Grad
data Turn
newtype Angle a = Angle Value
deriving (Angle a -> Value
(Angle a -> Value) -> Val (Angle a)
forall a. Angle a -> Value
forall a. (a -> Value) -> Val a
value :: Angle a -> Value
$cvalue :: forall a. Angle a -> Value
Val, Angle a
Angle a -> Auto (Angle a)
forall a. Angle a
forall a. a -> Auto a
auto :: Angle a
$cauto :: forall a. Angle a
Auto, Angle a
Angle a -> Inherit (Angle a)
forall a. Angle a
forall a. a -> Inherit a
inherit :: Angle a
$cinherit :: forall a. Angle a
Inherit, Value -> Angle a
(Value -> Angle a) -> Other (Angle a)
forall a. Value -> Angle a
forall a. (Value -> a) -> Other a
other :: Value -> Angle a
$cother :: forall a. Value -> Angle a
Other)
deg :: Double -> Angle Deg
deg :: Double -> Angle Deg
deg Double
i = Value -> Angle Deg
forall a. Value -> Angle a
Angle (Double -> Value
forall a. Val a => a -> Value
value Double
i Value -> Value -> Value
forall a. Semigroup a => a -> a -> a
<> Value
"deg")
rad :: Double -> Angle Rad
rad :: Double -> Angle Rad
rad Double
i = Value -> Angle Rad
forall a. Value -> Angle a
Angle (Double -> Value
forall a. Val a => a -> Value
value Double
i Value -> Value -> Value
forall a. Semigroup a => a -> a -> a
<> Value
"rad")
grad :: Double -> Angle Grad
grad :: Double -> Angle Grad
grad Double
i = Value -> Angle Grad
forall a. Value -> Angle a
Angle (Double -> Value
forall a. Val a => a -> Value
value Double
i Value -> Value -> Value
forall a. Semigroup a => a -> a -> a
<> Value
"grad")
turn :: Double -> Angle Turn
turn :: Double -> Angle Turn
turn Double
i = Value -> Angle Turn
forall a. Value -> Angle a
Angle (Double -> Value
forall a. Val a => a -> Value
value Double
i Value -> Value -> Value
forall a. Semigroup a => a -> a -> a
<> Value
"turn")
instance Num (Angle Deg) where
fromInteger :: Integer -> Angle Deg
fromInteger = Double -> Angle Deg
deg (Double -> Angle Deg)
-> (Integer -> Double) -> Integer -> Angle Deg
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Double
forall a. Num a => Integer -> a
fromInteger
+ :: Angle Deg -> Angle Deg -> Angle Deg
(+) = String -> Angle Deg -> Angle Deg -> Angle Deg
forall a. HasCallStack => String -> a
error String
"plus not implemented for Angle"
* :: Angle Deg -> Angle Deg -> Angle Deg
(*) = String -> Angle Deg -> Angle Deg -> Angle Deg
forall a. HasCallStack => String -> a
error String
"times not implemented for Angle"
abs :: Angle Deg -> Angle Deg
abs = String -> Angle Deg -> Angle Deg
forall a. HasCallStack => String -> a
error String
"abs not implemented for Angle"
signum :: Angle Deg -> Angle Deg
signum = String -> Angle Deg -> Angle Deg
forall a. HasCallStack => String -> a
error String
"signum not implemented for Angle"
negate :: Angle Deg -> Angle Deg
negate = String -> Angle Deg -> Angle Deg
forall a. HasCallStack => String -> a
error String
"negate not implemented for Angle"
instance Fractional (Angle Deg) where
fromRational :: Rational -> Angle Deg
fromRational = Double -> Angle Deg
deg (Double -> Angle Deg)
-> (Rational -> Double) -> Rational -> Angle Deg
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Rational -> Double
forall a. Fractional a => Rational -> a
fromRational
recip :: Angle Deg -> Angle Deg
recip = String -> Angle Deg -> Angle Deg
forall a. HasCallStack => String -> a
error String
"recip not implemented for Angle"
instance Num (Angle Rad) where
fromInteger :: Integer -> Angle Rad
fromInteger = Double -> Angle Rad
rad (Double -> Angle Rad)
-> (Integer -> Double) -> Integer -> Angle Rad
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Double
forall a. Num a => Integer -> a
fromInteger
+ :: Angle Rad -> Angle Rad -> Angle Rad
(+) = String -> Angle Rad -> Angle Rad -> Angle Rad
forall a. HasCallStack => String -> a
error String
"plus not implemented for Angle"
* :: Angle Rad -> Angle Rad -> Angle Rad
(*) = String -> Angle Rad -> Angle Rad -> Angle Rad
forall a. HasCallStack => String -> a
error String
"times not implemented for Angle"
abs :: Angle Rad -> Angle Rad
abs = String -> Angle Rad -> Angle Rad
forall a. HasCallStack => String -> a
error String
"abs not implemented for Angle"
signum :: Angle Rad -> Angle Rad
signum = String -> Angle Rad -> Angle Rad
forall a. HasCallStack => String -> a
error String
"signum not implemented for Angle"
negate :: Angle Rad -> Angle Rad
negate = String -> Angle Rad -> Angle Rad
forall a. HasCallStack => String -> a
error String
"negate not implemented for Angle"
instance Fractional (Angle Rad) where
fromRational :: Rational -> Angle Rad
fromRational = Double -> Angle Rad
rad (Double -> Angle Rad)
-> (Rational -> Double) -> Rational -> Angle Rad
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Rational -> Double
forall a. Fractional a => Rational -> a
fromRational
recip :: Angle Rad -> Angle Rad
recip = String -> Angle Rad -> Angle Rad
forall a. HasCallStack => String -> a
error String
"recip not implemented for Angle"
instance Num (Angle Grad) where
fromInteger :: Integer -> Angle Grad
fromInteger = Double -> Angle Grad
grad (Double -> Angle Grad)
-> (Integer -> Double) -> Integer -> Angle Grad
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Double
forall a. Num a => Integer -> a
fromInteger
+ :: Angle Grad -> Angle Grad -> Angle Grad
(+) = String -> Angle Grad -> Angle Grad -> Angle Grad
forall a. HasCallStack => String -> a
error String
"plus not implemented for Angle"
* :: Angle Grad -> Angle Grad -> Angle Grad
(*) = String -> Angle Grad -> Angle Grad -> Angle Grad
forall a. HasCallStack => String -> a
error String
"times not implemented for Angle"
abs :: Angle Grad -> Angle Grad
abs = String -> Angle Grad -> Angle Grad
forall a. HasCallStack => String -> a
error String
"abs not implemented for Angle"
signum :: Angle Grad -> Angle Grad
signum = String -> Angle Grad -> Angle Grad
forall a. HasCallStack => String -> a
error String
"signum not implemented for Angle"
negate :: Angle Grad -> Angle Grad
negate = String -> Angle Grad -> Angle Grad
forall a. HasCallStack => String -> a
error String
"negate not implemented for Angle"
instance Fractional (Angle Grad) where
fromRational :: Rational -> Angle Grad
fromRational = Double -> Angle Grad
grad (Double -> Angle Grad)
-> (Rational -> Double) -> Rational -> Angle Grad
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Rational -> Double
forall a. Fractional a => Rational -> a
fromRational
recip :: Angle Grad -> Angle Grad
recip = String -> Angle Grad -> Angle Grad
forall a. HasCallStack => String -> a
error String
"recip not implemented for Angle"
instance Num (Angle Turn) where
fromInteger :: Integer -> Angle Turn
fromInteger = Double -> Angle Turn
turn (Double -> Angle Turn)
-> (Integer -> Double) -> Integer -> Angle Turn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Double
forall a. Num a => Integer -> a
fromInteger
+ :: Angle Turn -> Angle Turn -> Angle Turn
(+) = String -> Angle Turn -> Angle Turn -> Angle Turn
forall a. HasCallStack => String -> a
error String
"plus not implemented for Angle"
* :: Angle Turn -> Angle Turn -> Angle Turn
(*) = String -> Angle Turn -> Angle Turn -> Angle Turn
forall a. HasCallStack => String -> a
error String
"times not implemented for Angle"
abs :: Angle Turn -> Angle Turn
abs = String -> Angle Turn -> Angle Turn
forall a. HasCallStack => String -> a
error String
"abs not implemented for Angle"
signum :: Angle Turn -> Angle Turn
signum = String -> Angle Turn -> Angle Turn
forall a. HasCallStack => String -> a
error String
"signum not implemented for Angle"
negate :: Angle Turn -> Angle Turn
negate = String -> Angle Turn -> Angle Turn
forall a. HasCallStack => String -> a
error String
"negate not implemented for Angle"
instance Fractional (Angle Turn) where
fromRational :: Rational -> Angle Turn
fromRational = Double -> Angle Turn
turn (Double -> Angle Turn)
-> (Rational -> Double) -> Rational -> Angle Turn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Rational -> Double
forall a. Fractional a => Rational -> a
fromRational
recip :: Angle Turn -> Angle Turn
recip = String -> Angle Turn -> Angle Turn
forall a. HasCallStack => String -> a
error String
"recip not implemented for Angle"