module Sound.Tidal.ID (ID(..)) where
import GHC.Exts ( IsString(..) )
newtype ID = ID { ID -> String
fromID :: String } deriving (ID -> ID -> Bool
(ID -> ID -> Bool) -> (ID -> ID -> Bool) -> Eq ID
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ID -> ID -> Bool
$c/= :: ID -> ID -> Bool
== :: ID -> ID -> Bool
$c== :: ID -> ID -> Bool
Eq, Int -> ID -> ShowS
[ID] -> ShowS
ID -> String
(Int -> ID -> ShowS)
-> (ID -> String) -> ([ID] -> ShowS) -> Show ID
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ID] -> ShowS
$cshowList :: [ID] -> ShowS
show :: ID -> String
$cshow :: ID -> String
showsPrec :: Int -> ID -> ShowS
$cshowsPrec :: Int -> ID -> ShowS
Show, Eq ID
Eq ID
-> (ID -> ID -> Ordering)
-> (ID -> ID -> Bool)
-> (ID -> ID -> Bool)
-> (ID -> ID -> Bool)
-> (ID -> ID -> Bool)
-> (ID -> ID -> ID)
-> (ID -> ID -> ID)
-> Ord ID
ID -> ID -> Bool
ID -> ID -> Ordering
ID -> ID -> ID
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ID -> ID -> ID
$cmin :: ID -> ID -> ID
max :: ID -> ID -> ID
$cmax :: ID -> ID -> ID
>= :: ID -> ID -> Bool
$c>= :: ID -> ID -> Bool
> :: ID -> ID -> Bool
$c> :: ID -> ID -> Bool
<= :: ID -> ID -> Bool
$c<= :: ID -> ID -> Bool
< :: ID -> ID -> Bool
$c< :: ID -> ID -> Bool
compare :: ID -> ID -> Ordering
$ccompare :: ID -> ID -> Ordering
$cp1Ord :: Eq ID
Ord, ReadPrec [ID]
ReadPrec ID
Int -> ReadS ID
ReadS [ID]
(Int -> ReadS ID)
-> ReadS [ID] -> ReadPrec ID -> ReadPrec [ID] -> Read ID
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ID]
$creadListPrec :: ReadPrec [ID]
readPrec :: ReadPrec ID
$creadPrec :: ReadPrec ID
readList :: ReadS [ID]
$creadList :: ReadS [ID]
readsPrec :: Int -> ReadS ID
$creadsPrec :: Int -> ReadS ID
Read)
noOv :: String -> a
noOv :: String -> a
noOv String
meth = String -> a
forall a. HasCallStack => String -> a
error (String -> a) -> String -> a
forall a b. (a -> b) -> a -> b
$ String
meth String -> ShowS
forall a. [a] -> [a] -> [a]
++ String
": not supported for ids"
instance Num ID where
fromInteger :: Integer -> ID
fromInteger = String -> ID
ID (String -> ID) -> (Integer -> String) -> Integer -> ID
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> String
forall a. Show a => a -> String
show
+ :: ID -> ID -> ID
(+) = String -> ID -> ID -> ID
forall a. String -> a
noOv String
"+"
* :: ID -> ID -> ID
(*) = String -> ID -> ID -> ID
forall a. String -> a
noOv String
"*"
abs :: ID -> ID
abs = String -> ID -> ID
forall a. String -> a
noOv String
"abs"
signum :: ID -> ID
signum = String -> ID -> ID
forall a. String -> a
noOv String
"signum"
(-) = String -> ID -> ID -> ID
forall a. String -> a
noOv String
"-"
instance IsString ID where
fromString :: String -> ID
fromString = String -> ID
ID