{-# LANGUAGE FlexibleInstances, BangPatterns #-}
module Sound.Tidal.Core where
import Prelude hiding ((<*), (*>))
import Data.Fixed (mod')
import qualified Data.Map.Strict as Map
import Data.Maybe (fromMaybe)
import Sound.Tidal.Pattern
sig :: (Time -> a) -> Pattern a
sig :: forall a. (Rational -> a) -> Pattern a
sig Rational -> a
f = forall a. (State -> [Event a]) -> Pattern a
Pattern State -> [EventF (ArcF Rational) a]
q
where q :: State -> [EventF (ArcF Rational) a]
q (State (Arc Rational
s Rational
e) ValueMap
_)
| Rational
s forall a. Ord a => a -> a -> Bool
> Rational
e = []
| Bool
otherwise = [forall a b. Context -> Maybe a -> a -> b -> EventF a b
Event ([((Int, Int), (Int, Int))] -> Context
Context []) forall a. Maybe a
Nothing (forall a. a -> a -> ArcF a
Arc Rational
s Rational
e) (Rational -> a
f (Rational
sforall a. Num a => a -> a -> a
+((Rational
eforall a. Num a => a -> a -> a
-Rational
s)forall a. Fractional a => a -> a -> a
/Rational
2)))]
sine :: Fractional a => Pattern a
sine :: forall a. Fractional a => Pattern a
sine = forall a. (Rational -> a) -> Pattern a
sig forall a b. (a -> b) -> a -> b
$ \Rational
t -> (Double -> a
sin_rat ((forall a. Floating a => a
pi :: Double) forall a. Num a => a -> a -> a
* Double
2 forall a. Num a => a -> a -> a
* forall a. Fractional a => Rational -> a
fromRational Rational
t) forall a. Num a => a -> a -> a
+ a
1) forall a. Fractional a => a -> a -> a
/ a
2
where sin_rat :: Double -> a
sin_rat = forall a. Fractional a => Rational -> a
fromRational forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Real a => a -> Rational
toRational forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Floating a => a -> a
sin
sine2 :: Fractional a => Pattern a
sine2 :: forall a. Fractional a => Pattern a
sine2 = forall a. (Rational -> a) -> Pattern a
sig forall a b. (a -> b) -> a -> b
$ \Rational
t -> Double -> a
sin_rat ((forall a. Floating a => a
pi :: Double) forall a. Num a => a -> a -> a
* Double
2 forall a. Num a => a -> a -> a
* forall a. Fractional a => Rational -> a
fromRational Rational
t)
where sin_rat :: Double -> a
sin_rat = forall a. Fractional a => Rational -> a
fromRational forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Real a => a -> Rational
toRational forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Floating a => a -> a
sin
cosine :: Fractional a => Pattern a
cosine :: forall a. Fractional a => Pattern a
cosine = Rational
0.25 forall a. Rational -> Pattern a -> Pattern a
`rotR` forall a. Fractional a => Pattern a
sine
cosine2 :: Fractional a => Pattern a
cosine2 :: forall a. Fractional a => Pattern a
cosine2 = Rational
0.25 forall a. Rational -> Pattern a -> Pattern a
`rotR` forall a. Fractional a => Pattern a
sine2
saw :: (Fractional a, Real a) => Pattern a
saw :: forall a. (Fractional a, Real a) => Pattern a
saw = forall a. (Rational -> a) -> Pattern a
sig forall a b. (a -> b) -> a -> b
$ \Rational
t -> forall a. Real a => a -> a -> a
mod' (forall a. Fractional a => Rational -> a
fromRational Rational
t) a
1
saw2 :: (Fractional a, Real a) => Pattern a
saw2 :: forall a. (Fractional a, Real a) => Pattern a
saw2 = forall a. (Rational -> a) -> Pattern a
sig forall a b. (a -> b) -> a -> b
$ \Rational
t -> forall a. Real a => a -> a -> a
mod' (forall a. Fractional a => Rational -> a
fromRational Rational
t) a
1 forall a. Num a => a -> a -> a
* a
2 forall a. Num a => a -> a -> a
- a
1
isaw :: (Fractional a, Real a) => Pattern a
isaw :: forall a. (Fractional a, Real a) => Pattern a
isaw = (a
1forall a. Num a => a -> a -> a
-) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. (Fractional a, Real a) => Pattern a
saw
isaw2 :: (Fractional a, Real a) => Pattern a
isaw2 :: forall a. (Fractional a, Real a) => Pattern a
isaw2 = (forall a. Num a => a -> a -> a
*(-a
1)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a. (Fractional a, Real a) => Pattern a
saw2
tri :: (Fractional a, Real a) => Pattern a
tri :: forall a. (Fractional a, Real a) => Pattern a
tri = forall a. Pattern a -> Pattern a -> Pattern a
fastAppend forall a. (Fractional a, Real a) => Pattern a
saw forall a. (Fractional a, Real a) => Pattern a
isaw
tri2 :: (Fractional a, Real a) => Pattern a
tri2 :: forall a. (Fractional a, Real a) => Pattern a
tri2 = forall a. Pattern a -> Pattern a -> Pattern a
fastAppend forall a. (Fractional a, Real a) => Pattern a
saw2 forall a. (Fractional a, Real a) => Pattern a
isaw2
square :: (Fractional a) => Pattern a
square :: forall a. Fractional a => Pattern a
square = forall a. (Rational -> a) -> Pattern a
sig forall a b. (a -> b) -> a -> b
$
\Rational
t -> forall a b. (Integral a, Num b) => a -> b
fromIntegral ((forall a b. (RealFrac a, Integral b) => a -> b
floor forall a b. (a -> b) -> a -> b
$ forall a. Real a => a -> a -> a
mod' (forall a. Fractional a => Rational -> a
fromRational Rational
t :: Double) Double
1 forall a. Num a => a -> a -> a
* Double
2) :: Integer)
square2 :: (Fractional a) => Pattern a
square2 :: forall a. Fractional a => Pattern a
square2 = forall a. (Rational -> a) -> Pattern a
sig forall a b. (a -> b) -> a -> b
$
\Rational
t -> forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a b. (RealFrac a, Integral b) => a -> b
floor (forall a. Real a => a -> a -> a
mod' (forall a. Fractional a => Rational -> a
fromRational Rational
t :: Double) Double
1 forall a. Num a => a -> a -> a
* Double
2) forall a. Num a => a -> a -> a
* Integer
2 forall a. Num a => a -> a -> a
- Integer
1 :: Integer)
envL :: Pattern Double
envL :: Pattern Double
envL = forall a. (Rational -> a) -> Pattern a
sig forall a b. (a -> b) -> a -> b
$ \Rational
t -> forall a. Ord a => a -> a -> a
max Double
0 forall a b. (a -> b) -> a -> b
$ forall a. Ord a => a -> a -> a
min (forall a. Fractional a => Rational -> a
fromRational Rational
t) Double
1
envLR :: Pattern Double
envLR :: Pattern Double
envLR = (Double
1forall a. Num a => a -> a -> a
-) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern Double
envL
envEq :: Pattern Double
envEq :: Pattern Double
envEq = forall a. (Rational -> a) -> Pattern a
sig forall a b. (a -> b) -> a -> b
$ \Rational
t -> forall a. Floating a => a -> a
sqrt (forall a. Floating a => a -> a
sin (forall a. Floating a => a
piforall a. Fractional a => a -> a -> a
/Double
2 forall a. Num a => a -> a -> a
* forall a. Ord a => a -> a -> a
max Double
0 (forall a. Ord a => a -> a -> a
min (forall a. Fractional a => Rational -> a
fromRational (Rational
1forall a. Num a => a -> a -> a
-Rational
t)) Double
1)))
envEqR :: Pattern Double
envEqR :: Pattern Double
envEqR = forall a. (Rational -> a) -> Pattern a
sig forall a b. (a -> b) -> a -> b
$ \Rational
t -> forall a. Floating a => a -> a
sqrt (forall a. Floating a => a -> a
cos (forall a. Floating a => a
piforall a. Fractional a => a -> a -> a
/Double
2 forall a. Num a => a -> a -> a
* forall a. Ord a => a -> a -> a
max Double
0 (forall a. Ord a => a -> a -> a
min (forall a. Fractional a => Rational -> a
fromRational (Rational
1forall a. Num a => a -> a -> a
-Rational
t)) Double
1)))
class Unionable a where
union :: a -> a -> a
instance Unionable a where
union :: a -> a -> a
union = forall a b. a -> b -> a
const
instance {-# OVERLAPPING #-} Unionable ValueMap where
union :: ValueMap -> ValueMap -> ValueMap
union = forall k a. Ord k => Map k a -> Map k a -> Map k a
Map.union
(|+|) :: (Applicative a, Num b) => a b -> a b -> a b
a b
a |+| :: forall (a :: * -> *) b. (Applicative a, Num b) => a b -> a b -> a b
|+| a b
b = forall a. Num a => a -> a -> a
(+) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a b
a forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> a b
b
(|+ ) :: Num a => Pattern a -> Pattern a -> Pattern a
Pattern a
a |+ :: forall a. Num a => Pattern a -> Pattern a -> Pattern a
|+ Pattern a
b = forall a. Num a => a -> a -> a
(+) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<* Pattern a
b
( +|) :: Num a => Pattern a -> Pattern a -> Pattern a
Pattern a
a +| :: forall a. Num a => Pattern a -> Pattern a -> Pattern a
+| Pattern a
b = forall a. Num a => a -> a -> a
(+) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
*> Pattern a
b
(||+) :: Num a => Pattern a -> Pattern a -> Pattern a
Pattern a
a ||+ :: forall a. Num a => Pattern a -> Pattern a -> Pattern a
||+ Pattern a
b = forall a. Num a => a -> a -> a
(+) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<<* Pattern a
b
(|++|) :: Applicative a => a String -> a String -> a String
a String
a |++| :: forall (a :: * -> *).
Applicative a =>
a String -> a String -> a String
|++| a String
b = forall a. [a] -> [a] -> [a]
(++) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a String
a forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> a String
b
(|++ ) :: Pattern String -> Pattern String -> Pattern String
Pattern String
a |++ :: Pattern String -> Pattern String -> Pattern String
|++ Pattern String
b = forall a. [a] -> [a] -> [a]
(++) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern String
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<* Pattern String
b
( ++|) :: Pattern String -> Pattern String -> Pattern String
Pattern String
a ++| :: Pattern String -> Pattern String -> Pattern String
++| Pattern String
b = forall a. [a] -> [a] -> [a]
(++) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern String
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
*> Pattern String
b
(||++) :: Pattern String -> Pattern String -> Pattern String
Pattern String
a ||++ :: Pattern String -> Pattern String -> Pattern String
||++ Pattern String
b = forall a. [a] -> [a] -> [a]
(++) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern String
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<<* Pattern String
b
(|/|) :: (Applicative a, Fractional b) => a b -> a b -> a b
a b
a |/| :: forall (a :: * -> *) b.
(Applicative a, Fractional b) =>
a b -> a b -> a b
|/| a b
b = forall a. Fractional a => a -> a -> a
(/) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a b
a forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> a b
b
(|/ ) :: Fractional a => Pattern a -> Pattern a -> Pattern a
Pattern a
a |/ :: forall a. Fractional a => Pattern a -> Pattern a -> Pattern a
|/ Pattern a
b = forall a. Fractional a => a -> a -> a
(/) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<* Pattern a
b
( /|) :: Fractional a => Pattern a -> Pattern a -> Pattern a
Pattern a
a /| :: forall a. Fractional a => Pattern a -> Pattern a -> Pattern a
/| Pattern a
b = forall a. Fractional a => a -> a -> a
(/) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
*> Pattern a
b
(||/) :: Fractional a => Pattern a -> Pattern a -> Pattern a
Pattern a
a ||/ :: forall a. Fractional a => Pattern a -> Pattern a -> Pattern a
||/ Pattern a
b = forall a. Fractional a => a -> a -> a
(/) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<<* Pattern a
b
(|*|) :: (Applicative a, Num b) => a b -> a b -> a b
a b
a |*| :: forall (a :: * -> *) b. (Applicative a, Num b) => a b -> a b -> a b
|*| a b
b = forall a. Num a => a -> a -> a
(*) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a b
a forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> a b
b
(|* ) :: Num a => Pattern a -> Pattern a -> Pattern a
Pattern a
a |* :: forall a. Num a => Pattern a -> Pattern a -> Pattern a
|* Pattern a
b = forall a. Num a => a -> a -> a
(*) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<* Pattern a
b
( *|) :: Num a => Pattern a -> Pattern a -> Pattern a
Pattern a
a *| :: forall a. Num a => Pattern a -> Pattern a -> Pattern a
*| Pattern a
b = forall a. Num a => a -> a -> a
(*) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
*> Pattern a
b
(||*) :: Num a => Pattern a -> Pattern a -> Pattern a
Pattern a
a ||* :: forall a. Num a => Pattern a -> Pattern a -> Pattern a
||* Pattern a
b = forall a. Num a => a -> a -> a
(*) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<<* Pattern a
b
(|-|) :: (Applicative a, Num b) => a b -> a b -> a b
a b
a |-| :: forall (a :: * -> *) b. (Applicative a, Num b) => a b -> a b -> a b
|-| a b
b = (-) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a b
a forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> a b
b
(|- ) :: Num a => Pattern a -> Pattern a -> Pattern a
Pattern a
a |- :: forall a. Num a => Pattern a -> Pattern a -> Pattern a
|- Pattern a
b = (-) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<* Pattern a
b
( -|) :: Num a => Pattern a -> Pattern a -> Pattern a
Pattern a
a -| :: forall a. Num a => Pattern a -> Pattern a -> Pattern a
-| Pattern a
b = (-) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
*> Pattern a
b
(||-) :: Num a => Pattern a -> Pattern a -> Pattern a
Pattern a
a ||- :: forall a. Num a => Pattern a -> Pattern a -> Pattern a
||- Pattern a
b = (-) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<<* Pattern a
b
(|%|) :: (Applicative a, Moddable b) => a b -> a b -> a b
a b
a |%| :: forall (a :: * -> *) b.
(Applicative a, Moddable b) =>
a b -> a b -> a b
|%| a b
b = forall a. Moddable a => a -> a -> a
gmod forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a b
a forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> a b
b
(|% ) :: Moddable a => Pattern a -> Pattern a -> Pattern a
Pattern a
a |% :: forall a. Moddable a => Pattern a -> Pattern a -> Pattern a
|% Pattern a
b = forall a. Moddable a => a -> a -> a
gmod forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<* Pattern a
b
( %|) :: Moddable a => Pattern a -> Pattern a -> Pattern a
Pattern a
a %| :: forall a. Moddable a => Pattern a -> Pattern a -> Pattern a
%| Pattern a
b = forall a. Moddable a => a -> a -> a
gmod forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
*> Pattern a
b
(||%) :: Moddable a => Pattern a -> Pattern a -> Pattern a
Pattern a
a ||% :: forall a. Moddable a => Pattern a -> Pattern a -> Pattern a
||% Pattern a
b = forall a. Moddable a => a -> a -> a
gmod forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<<* Pattern a
b
(|**|) :: (Applicative a, Floating b) => a b -> a b -> a b
a b
a |**| :: forall (a :: * -> *) b.
(Applicative a, Floating b) =>
a b -> a b -> a b
|**| a b
b = forall a. Floating a => a -> a -> a
(**) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a b
a forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> a b
b
(|** ) :: Floating a => Pattern a -> Pattern a -> Pattern a
Pattern a
a |** :: forall a. Floating a => Pattern a -> Pattern a -> Pattern a
|** Pattern a
b = forall a. Floating a => a -> a -> a
(**) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<* Pattern a
b
( **|) :: Floating a => Pattern a -> Pattern a -> Pattern a
Pattern a
a **| :: forall a. Floating a => Pattern a -> Pattern a -> Pattern a
**| Pattern a
b = forall a. Floating a => a -> a -> a
(**) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
*> Pattern a
b
(||**) :: Floating a => Pattern a -> Pattern a -> Pattern a
Pattern a
a ||** :: forall a. Floating a => Pattern a -> Pattern a -> Pattern a
||** Pattern a
b = forall a. Floating a => a -> a -> a
(**) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<<* Pattern a
b
(|>|) :: (Applicative a, Unionable b) => a b -> a b -> a b
a b
a |>| :: forall (a :: * -> *) b.
(Applicative a, Unionable b) =>
a b -> a b -> a b
|>| a b
b = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a. Unionable a => a -> a -> a
union forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a b
a forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> a b
b
(|> ) :: Unionable a => Pattern a -> Pattern a -> Pattern a
Pattern a
a |> :: forall a. Unionable a => Pattern a -> Pattern a -> Pattern a
|> Pattern a
b = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a. Unionable a => a -> a -> a
union forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<* Pattern a
b
( >|) :: Unionable a => Pattern a -> Pattern a -> Pattern a
Pattern a
a >| :: forall a. Unionable a => Pattern a -> Pattern a -> Pattern a
>| Pattern a
b = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a. Unionable a => a -> a -> a
union forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
*> Pattern a
b
(||>) :: Unionable a => Pattern a -> Pattern a -> Pattern a
Pattern a
a ||> :: forall a. Unionable a => Pattern a -> Pattern a -> Pattern a
||> Pattern a
b = forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a. Unionable a => a -> a -> a
union forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<<* Pattern a
b
(|<|) :: (Applicative a, Unionable b) => a b -> a b -> a b
a b
a |<| :: forall (a :: * -> *) b.
(Applicative a, Unionable b) =>
a b -> a b -> a b
|<| a b
b = forall a. Unionable a => a -> a -> a
union forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> a b
a forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> a b
b
(|< ) :: Unionable a => Pattern a -> Pattern a -> Pattern a
Pattern a
a |< :: forall a. Unionable a => Pattern a -> Pattern a -> Pattern a
|< Pattern a
b = forall a. Unionable a => a -> a -> a
union forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<* Pattern a
b
( <|) :: Unionable a => Pattern a -> Pattern a -> Pattern a
Pattern a
a <| :: forall a. Unionable a => Pattern a -> Pattern a -> Pattern a
<| Pattern a
b = forall a. Unionable a => a -> a -> a
union forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
*> Pattern a
b
(||<) :: Unionable a => Pattern a -> Pattern a -> Pattern a
Pattern a
a ||< :: forall a. Unionable a => Pattern a -> Pattern a -> Pattern a
||< Pattern a
b = forall a. Unionable a => a -> a -> a
union forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern a
a forall a b. Pattern (a -> b) -> Pattern a -> Pattern b
<<* Pattern a
b
(#) :: Unionable b => Pattern b -> Pattern b -> Pattern b
# :: forall a. Unionable a => Pattern a -> Pattern a -> Pattern a
(#) = forall a. Unionable a => Pattern a -> Pattern a -> Pattern a
(|>)
fromList :: [a] -> Pattern a
fromList :: forall a. [a] -> Pattern a
fromList = forall a. [Pattern a] -> Pattern a
cat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (f :: * -> *) a. Applicative f => a -> f a
pure
fastFromList :: [a] -> Pattern a
fastFromList :: forall a. [a] -> Pattern a
fastFromList = forall a. [Pattern a] -> Pattern a
fastcat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall (f :: * -> *) a. Applicative f => a -> f a
pure
listToPat :: [a] -> Pattern a
listToPat :: forall a. [a] -> Pattern a
listToPat = forall a. [a] -> Pattern a
fastFromList
fromMaybes :: [Maybe a] -> Pattern a
fromMaybes :: forall a. [Maybe a] -> Pattern a
fromMaybes = forall a. [Pattern a] -> Pattern a
fastcat forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall {a}. Maybe a -> Pattern a
f
where f :: Maybe a -> Pattern a
f Maybe a
Nothing = forall a. Pattern a
silence
f (Just a
x) = forall (f :: * -> *) a. Applicative f => a -> f a
pure a
x
run :: (Enum a, Num a) => Pattern a -> Pattern a
run :: forall a. (Enum a, Num a) => Pattern a -> Pattern a
run = (forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall a. (Enum a, Num a) => a -> Pattern a
_run)
_run :: (Enum a, Num a) => a -> Pattern a
_run :: forall a. (Enum a, Num a) => a -> Pattern a
_run a
n = forall a. [a] -> Pattern a
fastFromList [a
0 .. a
nforall a. Num a => a -> a -> a
-a
1]
scan :: (Enum a, Num a) => Pattern a -> Pattern a
scan :: forall a. (Enum a, Num a) => Pattern a -> Pattern a
scan = (forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= forall a. (Enum a, Num a) => a -> Pattern a
_scan)
_scan :: (Enum a, Num a) => a -> Pattern a
_scan :: forall a. (Enum a, Num a) => a -> Pattern a
_scan a
n = forall a. [Pattern a] -> Pattern a
slowcat forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map forall a. (Enum a, Num a) => a -> Pattern a
_run [a
1 .. a
n]
append :: Pattern a -> Pattern a -> Pattern a
append :: forall a. Pattern a -> Pattern a -> Pattern a
append Pattern a
a Pattern a
b = forall a. [Pattern a] -> Pattern a
cat [Pattern a
a,Pattern a
b]
cat :: [Pattern a] -> Pattern a
cat :: forall a. [Pattern a] -> Pattern a
cat [] = forall a. Pattern a
silence
cat [Pattern a]
ps = forall a. (State -> [Event a]) -> Pattern a
Pattern State -> [Event a]
q
where n :: Int
n = forall (t :: * -> *) a. Foldable t => t a -> Int
length [Pattern a]
ps
q :: State -> [Event a]
q State
st = forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
concatMap (State -> ArcF Rational -> [Event a]
f State
st) forall a b. (a -> b) -> a -> b
$ ArcF Rational -> [ArcF Rational]
arcCyclesZW (State -> ArcF Rational
arc State
st)
f :: State -> ArcF Rational -> [Event a]
f State
st ArcF Rational
a = forall a. Pattern a -> State -> [Event a]
query (forall a. (Rational -> Rational) -> Pattern a -> Pattern a
withResultTime (forall a. Num a => a -> a -> a
+Rational
offset) Pattern a
p) forall a b. (a -> b) -> a -> b
$ State
st {arc :: ArcF Rational
arc = forall a. a -> a -> ArcF a
Arc (forall a. Num a => a -> a -> a
subtract Rational
offset (forall a. ArcF a -> a
start ArcF Rational
a)) (forall a. Num a => a -> a -> a
subtract Rational
offset (forall a. ArcF a -> a
stop ArcF Rational
a))}
where p :: Pattern a
p = [Pattern a]
ps forall a. [a] -> Int -> a
!! Int
i
cyc :: Int
cyc = (forall a b. (RealFrac a, Integral b) => a -> b
floor forall a b. (a -> b) -> a -> b
$ forall a. ArcF a -> a
start ArcF Rational
a) :: Int
i :: Int
i = Int
cyc forall a. Integral a => a -> a -> a
`mod` Int
n
offset :: Rational
offset = (forall a b. (Integral a, Num b) => a -> b
fromIntegral forall a b. (a -> b) -> a -> b
$ Int
cyc forall a. Num a => a -> a -> a
- ((Int
cyc forall a. Num a => a -> a -> a
- Int
i) forall a. Integral a => a -> a -> a
`div` Int
n)) :: Time
slowCat :: [Pattern a] -> Pattern a
slowCat :: forall a. [Pattern a] -> Pattern a
slowCat = forall a. [Pattern a] -> Pattern a
cat
slowcat :: [Pattern a] -> Pattern a
slowcat :: forall a. [Pattern a] -> Pattern a
slowcat = forall a. [Pattern a] -> Pattern a
slowCat
slowAppend :: Pattern a -> Pattern a -> Pattern a
slowAppend :: forall a. Pattern a -> Pattern a -> Pattern a
slowAppend = forall a. Pattern a -> Pattern a -> Pattern a
append
slowappend :: Pattern a -> Pattern a -> Pattern a
slowappend :: forall a. Pattern a -> Pattern a -> Pattern a
slowappend = forall a. Pattern a -> Pattern a -> Pattern a
append
fastAppend :: Pattern a -> Pattern a -> Pattern a
fastAppend :: forall a. Pattern a -> Pattern a -> Pattern a
fastAppend Pattern a
a Pattern a
b = forall a. Rational -> Pattern a -> Pattern a
_fast Rational
2 forall a b. (a -> b) -> a -> b
$ forall a. Pattern a -> Pattern a -> Pattern a
append Pattern a
a Pattern a
b
fastappend :: Pattern a -> Pattern a -> Pattern a
fastappend :: forall a. Pattern a -> Pattern a -> Pattern a
fastappend = forall a. Pattern a -> Pattern a -> Pattern a
fastAppend
fastCat :: [Pattern a] -> Pattern a
fastCat :: forall a. [Pattern a] -> Pattern a
fastCat [Pattern a]
ps = forall a. Rational -> Pattern a -> Pattern a
_fast (forall a. Real a => a -> Rational
toTime forall a b. (a -> b) -> a -> b
$ forall (t :: * -> *) a. Foldable t => t a -> Int
length [Pattern a]
ps) forall a b. (a -> b) -> a -> b
$ forall a. [Pattern a] -> Pattern a
cat [Pattern a]
ps
fastcat :: [Pattern a] -> Pattern a
fastcat :: forall a. [Pattern a] -> Pattern a
fastcat = forall a. [Pattern a] -> Pattern a
fastCat
timeCat :: [(Time, Pattern a)] -> Pattern a
timeCat :: forall a. [(Rational, Pattern a)] -> Pattern a
timeCat [(Rational, Pattern a)]
tps = forall a. [Pattern a] -> Pattern a
stack forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map (\(Rational
s,Rational
e,Pattern a
p) -> forall a. ArcF Rational -> Pattern a -> Pattern a
compressArc (forall a. a -> a -> ArcF a
Arc (Rational
sforall a. Fractional a => a -> a -> a
/Rational
total) (Rational
eforall a. Fractional a => a -> a -> a
/Rational
total)) Pattern a
p) forall a b. (a -> b) -> a -> b
$ forall a.
Rational
-> [(Rational, Pattern a)] -> [(Rational, Rational, Pattern a)]
arrange Rational
0 [(Rational, Pattern a)]
tps
where total :: Rational
total = forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum forall a b. (a -> b) -> a -> b
$ forall a b. (a -> b) -> [a] -> [b]
map forall a b. (a, b) -> a
fst [(Rational, Pattern a)]
tps
arrange :: Time -> [(Time, Pattern a)] -> [(Time, Time, Pattern a)]
arrange :: forall a.
Rational
-> [(Rational, Pattern a)] -> [(Rational, Rational, Pattern a)]
arrange Rational
_ [] = []
arrange Rational
t ((Rational
t',Pattern a
p):[(Rational, Pattern a)]
tps') = (Rational
t,Rational
tforall a. Num a => a -> a -> a
+Rational
t',Pattern a
p) forall a. a -> [a] -> [a]
: forall a.
Rational
-> [(Rational, Pattern a)] -> [(Rational, Rational, Pattern a)]
arrange (Rational
tforall a. Num a => a -> a -> a
+Rational
t') [(Rational, Pattern a)]
tps'
timecat :: [(Time, Pattern a)] -> Pattern a
timecat :: forall a. [(Rational, Pattern a)] -> Pattern a
timecat = forall a. [(Rational, Pattern a)] -> Pattern a
timeCat
overlay :: Pattern a -> Pattern a -> Pattern a
overlay :: forall a. Pattern a -> Pattern a -> Pattern a
overlay = forall a. Semigroup a => a -> a -> a
(<>)
stack :: [Pattern a] -> Pattern a
stack :: forall a. [Pattern a] -> Pattern a
stack = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr forall a. Pattern a -> Pattern a -> Pattern a
overlay forall a. Pattern a
silence
(<~) :: Pattern Time -> Pattern a -> Pattern a
<~ :: forall a. Pattern Rational -> Pattern a -> Pattern a
(<~) = forall t1 t2 a.
(t1 -> t2 -> Pattern a) -> Pattern t1 -> t2 -> Pattern a
tParam forall a. Rational -> Pattern a -> Pattern a
rotL
(~>) :: Pattern Time -> Pattern a -> Pattern a
~> :: forall a. Pattern Rational -> Pattern a -> Pattern a
(~>) = forall t1 t2 a.
(t1 -> t2 -> Pattern a) -> Pattern t1 -> t2 -> Pattern a
tParam forall a. Rational -> Pattern a -> Pattern a
rotR
slowSqueeze :: Pattern Time -> Pattern a -> Pattern a
slowSqueeze :: forall a. Pattern Rational -> Pattern a -> Pattern a
slowSqueeze = forall a b c.
(a -> Pattern b -> Pattern c)
-> Pattern a -> Pattern b -> Pattern c
tParamSqueeze forall a. Rational -> Pattern a -> Pattern a
_slow
sparsity :: Pattern Time -> Pattern a -> Pattern a
sparsity :: forall a. Pattern Rational -> Pattern a -> Pattern a
sparsity = forall a. Pattern Rational -> Pattern a -> Pattern a
slow
zoom :: (Time, Time) -> Pattern a -> Pattern a
zoom :: forall a. (Rational, Rational) -> Pattern a -> Pattern a
zoom (Rational
s,Rational
e) = forall a. ArcF Rational -> Pattern a -> Pattern a
zoomArc (forall a. a -> a -> ArcF a
Arc Rational
s Rational
e)
zoomArc :: Arc -> Pattern a -> Pattern a
zoomArc :: forall a. ArcF Rational -> Pattern a -> Pattern a
zoomArc (Arc Rational
s Rational
e) Pattern a
p = forall a. Pattern a -> Pattern a
splitQueries forall a b. (a -> b) -> a -> b
$
forall a.
(ArcF Rational -> ArcF Rational) -> Pattern a -> Pattern a
withResultArc ((Rational -> Rational) -> ArcF Rational -> ArcF Rational
mapCycle ((forall a. Fractional a => a -> a -> a
/Rational
d) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Num a => a -> a -> a
subtract Rational
s)) forall a b. (a -> b) -> a -> b
$ forall a.
(ArcF Rational -> ArcF Rational) -> Pattern a -> Pattern a
withQueryArc ((Rational -> Rational) -> ArcF Rational -> ArcF Rational
mapCycle ((forall a. Num a => a -> a -> a
+Rational
s) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a. Num a => a -> a -> a
*Rational
d))) Pattern a
p
where d :: Rational
d = Rational
eforall a. Num a => a -> a -> a
-Rational
s
fastGap :: Pattern Time -> Pattern a -> Pattern a
fastGap :: forall a. Pattern Rational -> Pattern a -> Pattern a
fastGap = forall t1 t2 a.
(t1 -> t2 -> Pattern a) -> Pattern t1 -> t2 -> Pattern a
tParam forall a. Rational -> Pattern a -> Pattern a
_fastGap
densityGap :: Pattern Time -> Pattern a -> Pattern a
densityGap :: forall a. Pattern Rational -> Pattern a -> Pattern a
densityGap = forall a. Pattern Rational -> Pattern a -> Pattern a
fastGap
compress :: (Time,Time) -> Pattern a -> Pattern a
compress :: forall a. (Rational, Rational) -> Pattern a -> Pattern a
compress (Rational
s,Rational
e) = forall a. ArcF Rational -> Pattern a -> Pattern a
compressArc (forall a. a -> a -> ArcF a
Arc Rational
s Rational
e)
compressTo :: (Time,Time) -> Pattern a -> Pattern a
compressTo :: forall a. (Rational, Rational) -> Pattern a -> Pattern a
compressTo (Rational
s,Rational
e) = forall a. ArcF Rational -> Pattern a -> Pattern a
compressArcTo (forall a. a -> a -> ArcF a
Arc Rational
s Rational
e)
repeatCycles :: Pattern Int -> Pattern a -> Pattern a
repeatCycles :: forall a. Pattern Int -> Pattern a -> Pattern a
repeatCycles = forall t1 t2 a.
(t1 -> t2 -> Pattern a) -> Pattern t1 -> t2 -> Pattern a
tParam forall a. Int -> Pattern a -> Pattern a
_repeatCycles
_repeatCycles :: Int -> Pattern a -> Pattern a
_repeatCycles :: forall a. Int -> Pattern a -> Pattern a
_repeatCycles Int
n Pattern a
p = forall a. [Pattern a] -> Pattern a
cat (forall a. Int -> a -> [a]
replicate Int
n Pattern a
p)
fastRepeatCycles :: Int -> Pattern a -> Pattern a
fastRepeatCycles :: forall a. Int -> Pattern a -> Pattern a
fastRepeatCycles Int
n Pattern a
p = forall a. [Pattern a] -> Pattern a
cat (forall a. Int -> a -> [a]
replicate Int
n Pattern a
p)
every :: Pattern Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
every :: forall a.
Pattern Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
every Pattern Int
tp Pattern a -> Pattern a
f Pattern a
p = forall a. Pattern (Pattern a) -> Pattern a
innerJoin forall a b. (a -> b) -> a -> b
$ (\Int
t -> forall a. Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
_every Int
t Pattern a -> Pattern a
f Pattern a
p) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern Int
tp
_every :: Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
_every :: forall a. Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
_every Int
0 Pattern a -> Pattern a
_ Pattern a
p = Pattern a
p
_every Int
n Pattern a -> Pattern a
f Pattern a
p = forall a.
(Int -> Bool) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
when ((forall a. Eq a => a -> a -> Bool
== Int
0) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a. Integral a => a -> a -> a
`mod` Int
n)) Pattern a -> Pattern a
f Pattern a
p
every' :: Pattern Int -> Pattern Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
every' :: forall a.
Pattern Int
-> Pattern Int
-> (Pattern a -> Pattern a)
-> Pattern a
-> Pattern a
every' Pattern Int
np Pattern Int
op Pattern a -> Pattern a
f Pattern a
p = do { Int
n <- Pattern Int
np; Int
o <- Pattern Int
op; forall a.
Int -> Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
_every' Int
n Int
o Pattern a -> Pattern a
f Pattern a
p }
_every' :: Int -> Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
_every' :: forall a.
Int -> Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
_every' Int
n Int
o = forall a.
(Int -> Bool) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
when ((forall a. Eq a => a -> a -> Bool
== Int
o) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a. Integral a => a -> a -> a
`mod` Int
n))
foldEvery :: [Int] -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
foldEvery :: forall a.
[Int] -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
foldEvery [Int]
ns Pattern a -> Pattern a
f Pattern a
p = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr (forall a. Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
`_every` Pattern a -> Pattern a
f) Pattern a
p [Int]
ns
when :: (Int -> Bool) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
when :: forall a.
(Int -> Bool) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
when Int -> Bool
test Pattern a -> Pattern a
f Pattern a
p = forall a. Pattern a -> Pattern a
splitQueries forall a b. (a -> b) -> a -> b
$ Pattern a
p {query :: State -> [Event a]
query = State -> [Event a]
apply}
where apply :: State -> [Event a]
apply State
st | Int -> Bool
test (forall a b. (RealFrac a, Integral b) => a -> b
floor forall a b. (a -> b) -> a -> b
$ forall a. ArcF a -> a
start forall a b. (a -> b) -> a -> b
$ State -> ArcF Rational
arc State
st) = forall a. Pattern a -> State -> [Event a]
query (Pattern a -> Pattern a
f Pattern a
p) State
st
| Bool
otherwise = forall a. Pattern a -> State -> [Event a]
query Pattern a
p State
st
whenT :: (Time -> Bool) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
whenT :: forall a.
(Rational -> Bool)
-> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
whenT Rational -> Bool
test Pattern a -> Pattern a
f Pattern a
p = forall a. Pattern a -> Pattern a
splitQueries forall a b. (a -> b) -> a -> b
$ Pattern a
p {query :: State -> [Event a]
query = State -> [Event a]
apply}
where apply :: State -> [Event a]
apply State
st | Rational -> Bool
test (forall a. ArcF a -> a
start forall a b. (a -> b) -> a -> b
$ State -> ArcF Rational
arc State
st) = forall a. Pattern a -> State -> [Event a]
query (Pattern a -> Pattern a
f Pattern a
p) State
st
| Bool
otherwise = forall a. Pattern a -> State -> [Event a]
query Pattern a
p State
st
_getP_ :: (Value -> Maybe a) -> Pattern Value -> Pattern a
_getP_ :: forall a. (Value -> Maybe a) -> Pattern Value -> Pattern a
_getP_ Value -> Maybe a
f Pattern Value
pat = forall a. Pattern (Maybe a) -> Pattern a
filterJust forall a b. (a -> b) -> a -> b
$ Value -> Maybe a
f forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern Value
pat
_getP :: a -> (Value -> Maybe a) -> Pattern Value -> Pattern a
_getP :: forall a. a -> (Value -> Maybe a) -> Pattern Value -> Pattern a
_getP a
d Value -> Maybe a
f Pattern Value
pat = forall a. a -> Maybe a -> a
fromMaybe a
d forall b c a. (b -> c) -> (a -> b) -> a -> c
. Value -> Maybe a
f forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Pattern Value
pat
_cX :: a -> (Value -> Maybe a) -> String -> Pattern a
_cX :: forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX a
d Value -> Maybe a
f String
s = forall a. (State -> [Event a]) -> Pattern a
Pattern forall a b. (a -> b) -> a -> b
$ \(State ArcF Rational
a ValueMap
m) -> forall a. Pattern a -> ArcF Rational -> [Event a]
queryArc (forall b a. b -> (a -> b) -> Maybe a -> b
maybe (forall (f :: * -> *) a. Applicative f => a -> f a
pure a
d) (forall a. a -> (Value -> Maybe a) -> Pattern Value -> Pattern a
_getP a
d Value -> Maybe a
f forall b c a. (b -> c) -> (a -> b) -> a -> c
. Value -> Pattern Value
valueToPattern) forall a b. (a -> b) -> a -> b
$ forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup String
s ValueMap
m) ArcF Rational
a
_cX_ :: (Value -> Maybe a) -> String -> Pattern a
_cX_ :: forall a. (Value -> Maybe a) -> String -> Pattern a
_cX_ Value -> Maybe a
f String
s = forall a. (State -> [Event a]) -> Pattern a
Pattern forall a b. (a -> b) -> a -> b
$ \(State ArcF Rational
a ValueMap
m) -> forall a. Pattern a -> ArcF Rational -> [Event a]
queryArc (forall b a. b -> (a -> b) -> Maybe a -> b
maybe forall a. Pattern a
silence (forall a. (Value -> Maybe a) -> Pattern Value -> Pattern a
_getP_ Value -> Maybe a
f forall b c a. (b -> c) -> (a -> b) -> a -> c
. Value -> Pattern Value
valueToPattern) forall a b. (a -> b) -> a -> b
$ forall k a. Ord k => k -> Map k a -> Maybe a
Map.lookup String
s ValueMap
m) ArcF Rational
a
cF :: Double -> String -> Pattern Double
cF :: Double -> String -> Pattern Double
cF Double
d = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX Double
d Value -> Maybe Double
getF
cF_ :: String -> Pattern Double
cF_ :: String -> Pattern Double
cF_ = forall a. (Value -> Maybe a) -> String -> Pattern a
_cX_ Value -> Maybe Double
getF
cF0 :: String -> Pattern Double
cF0 :: String -> Pattern Double
cF0 = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX Double
0 Value -> Maybe Double
getF
cN :: Note -> String -> Pattern Note
cN :: Note -> String -> Pattern Note
cN Note
d = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX Note
d Value -> Maybe Note
getN
cN_ :: String -> Pattern Note
cN_ :: String -> Pattern Note
cN_ = forall a. (Value -> Maybe a) -> String -> Pattern a
_cX_ Value -> Maybe Note
getN
cN0 :: String -> Pattern Note
cN0 :: String -> Pattern Note
cN0 = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX (Double -> Note
Note Double
0) Value -> Maybe Note
getN
cI :: Int -> String -> Pattern Int
cI :: Int -> String -> Pattern Int
cI Int
d = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX Int
d Value -> Maybe Int
getI
cI_ :: String -> Pattern Int
cI_ :: String -> Pattern Int
cI_ = forall a. (Value -> Maybe a) -> String -> Pattern a
_cX_ Value -> Maybe Int
getI
cI0 :: String -> Pattern Int
cI0 :: String -> Pattern Int
cI0 = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX Int
0 Value -> Maybe Int
getI
cB :: Bool -> String -> Pattern Bool
cB :: Bool -> String -> Pattern Bool
cB Bool
d = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX Bool
d Value -> Maybe Bool
getB
cB_ :: String -> Pattern Bool
cB_ :: String -> Pattern Bool
cB_ = forall a. (Value -> Maybe a) -> String -> Pattern a
_cX_ Value -> Maybe Bool
getB
cB0 :: String -> Pattern Bool
cB0 :: String -> Pattern Bool
cB0 = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX Bool
False Value -> Maybe Bool
getB
cR :: Rational -> String -> Pattern Rational
cR :: Rational -> String -> Pattern Rational
cR Rational
d = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX Rational
d Value -> Maybe Rational
getR
cR_ :: String -> Pattern Rational
cR_ :: String -> Pattern Rational
cR_ = forall a. (Value -> Maybe a) -> String -> Pattern a
_cX_ Value -> Maybe Rational
getR
cR0 :: String -> Pattern Rational
cR0 :: String -> Pattern Rational
cR0 = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX Rational
0 Value -> Maybe Rational
getR
cT :: Time -> String -> Pattern Time
cT :: Rational -> String -> Pattern Rational
cT = Rational -> String -> Pattern Rational
cR
cT0 :: String -> Pattern Time
cT0 :: String -> Pattern Rational
cT0 = String -> Pattern Rational
cR0
cT_ :: String -> Pattern Time
cT_ :: String -> Pattern Rational
cT_ = String -> Pattern Rational
cR_
cS :: String -> String -> Pattern String
cS :: String -> String -> Pattern String
cS String
d = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX String
d Value -> Maybe String
getS
cS_ :: String -> Pattern String
cS_ :: String -> Pattern String
cS_ = forall a. (Value -> Maybe a) -> String -> Pattern a
_cX_ Value -> Maybe String
getS
cS0 :: String -> Pattern String
cS0 :: String -> Pattern String
cS0 = forall a. a -> (Value -> Maybe a) -> String -> Pattern a
_cX String
"" Value -> Maybe String
getS
in0 :: Pattern Double
in0 :: Pattern Double
in0 = Double -> String -> Pattern Double
cF Double
0 String
"0"
in1 :: Pattern Double
in1 :: Pattern Double
in1 = Double -> String -> Pattern Double
cF Double
0 String
"1"
in2 :: Pattern Double
in2 :: Pattern Double
in2 = Double -> String -> Pattern Double
cF Double
0 String
"2"
in3 :: Pattern Double
in3 :: Pattern Double
in3 = Double -> String -> Pattern Double
cF Double
0 String
"3"
in4 :: Pattern Double
in4 :: Pattern Double
in4 = Double -> String -> Pattern Double
cF Double
0 String
"4"
in5 :: Pattern Double
in5 :: Pattern Double
in5 = Double -> String -> Pattern Double
cF Double
0 String
"5"
in6 :: Pattern Double
in6 :: Pattern Double
in6 = Double -> String -> Pattern Double
cF Double
0 String
"6"
in7 :: Pattern Double
in7 :: Pattern Double
in7 = Double -> String -> Pattern Double
cF Double
0 String
"7"
in8 :: Pattern Double
in8 :: Pattern Double
in8 = Double -> String -> Pattern Double
cF Double
0 String
"8"
in9 :: Pattern Double
in9 :: Pattern Double
in9 = Double -> String -> Pattern Double
cF Double
0 String
"9"
in10 :: Pattern Double
in10 :: Pattern Double
in10 = Double -> String -> Pattern Double
cF Double
0 String
"10"
in11 :: Pattern Double
in11 :: Pattern Double
in11 = Double -> String -> Pattern Double
cF Double
0 String
"11"
in12 :: Pattern Double
in12 :: Pattern Double
in12 = Double -> String -> Pattern Double
cF Double
0 String
"12"
in13 :: Pattern Double
in13 :: Pattern Double
in13 = Double -> String -> Pattern Double
cF Double
0 String
"13"
in14 :: Pattern Double
in14 :: Pattern Double
in14 = Double -> String -> Pattern Double
cF Double
0 String
"14"
in15 :: Pattern Double
in15 :: Pattern Double
in15 = Double -> String -> Pattern Double
cF Double
0 String
"15"
in16 :: Pattern Double
in16 :: Pattern Double
in16 = Double -> String -> Pattern Double
cF Double
0 String
"16"
in17 :: Pattern Double
in17 :: Pattern Double
in17 = Double -> String -> Pattern Double
cF Double
0 String
"17"
in18 :: Pattern Double
in18 :: Pattern Double
in18 = Double -> String -> Pattern Double
cF Double
0 String
"18"
in19 :: Pattern Double
in19 :: Pattern Double
in19 = Double -> String -> Pattern Double
cF Double
0 String
"19"
in20 :: Pattern Double
in20 :: Pattern Double
in20 = Double -> String -> Pattern Double
cF Double
0 String
"20"
in21 :: Pattern Double
in21 :: Pattern Double
in21 = Double -> String -> Pattern Double
cF Double
0 String
"21"
in22 :: Pattern Double
in22 :: Pattern Double
in22 = Double -> String -> Pattern Double
cF Double
0 String
"22"
in23 :: Pattern Double
in23 :: Pattern Double
in23 = Double -> String -> Pattern Double
cF Double
0 String
"23"
in24 :: Pattern Double
in24 :: Pattern Double
in24 = Double -> String -> Pattern Double
cF Double
0 String
"24"
in25 :: Pattern Double
in25 :: Pattern Double
in25 = Double -> String -> Pattern Double
cF Double
0 String
"25"
in26 :: Pattern Double
in26 :: Pattern Double
in26 = Double -> String -> Pattern Double
cF Double
0 String
"26"
in27 :: Pattern Double
in27 :: Pattern Double
in27 = Double -> String -> Pattern Double
cF Double
0 String
"27"
in28 :: Pattern Double
in28 :: Pattern Double
in28 = Double -> String -> Pattern Double
cF Double
0 String
"28"
in29 :: Pattern Double
in29 :: Pattern Double
in29 = Double -> String -> Pattern Double
cF Double
0 String
"29"
in30 :: Pattern Double
in30 :: Pattern Double
in30 = Double -> String -> Pattern Double
cF Double
0 String
"30"
in31 :: Pattern Double
in31 :: Pattern Double
in31 = Double -> String -> Pattern Double
cF Double
0 String
"31"
in32 :: Pattern Double
in32 :: Pattern Double
in32 = Double -> String -> Pattern Double
cF Double
0 String
"32"
in33 :: Pattern Double
in33 :: Pattern Double
in33 = Double -> String -> Pattern Double
cF Double
0 String
"33"
in34 :: Pattern Double
in34 :: Pattern Double
in34 = Double -> String -> Pattern Double
cF Double
0 String
"34"
in35 :: Pattern Double
in35 :: Pattern Double
in35 = Double -> String -> Pattern Double
cF Double
0 String
"35"
in36 :: Pattern Double
in36 :: Pattern Double
in36 = Double -> String -> Pattern Double
cF Double
0 String
"36"
in37 :: Pattern Double
in37 :: Pattern Double
in37 = Double -> String -> Pattern Double
cF Double
0 String
"37"
in38 :: Pattern Double
in38 :: Pattern Double
in38 = Double -> String -> Pattern Double
cF Double
0 String
"38"
in39 :: Pattern Double
in39 :: Pattern Double
in39 = Double -> String -> Pattern Double
cF Double
0 String
"39"
in40 :: Pattern Double
in40 :: Pattern Double
in40 = Double -> String -> Pattern Double
cF Double
0 String
"40"
in41 :: Pattern Double
in41 :: Pattern Double
in41 = Double -> String -> Pattern Double
cF Double
0 String
"41"
in42 :: Pattern Double
in42 :: Pattern Double
in42 = Double -> String -> Pattern Double
cF Double
0 String
"42"
in43 :: Pattern Double
in43 :: Pattern Double
in43 = Double -> String -> Pattern Double
cF Double
0 String
"43"
in44 :: Pattern Double
in44 :: Pattern Double
in44 = Double -> String -> Pattern Double
cF Double
0 String
"44"
in45 :: Pattern Double
in45 :: Pattern Double
in45 = Double -> String -> Pattern Double
cF Double
0 String
"45"
in46 :: Pattern Double
in46 :: Pattern Double
in46 = Double -> String -> Pattern Double
cF Double
0 String
"46"
in47 :: Pattern Double
in47 :: Pattern Double
in47 = Double -> String -> Pattern Double
cF Double
0 String
"47"
in48 :: Pattern Double
in48 :: Pattern Double
in48 = Double -> String -> Pattern Double
cF Double
0 String
"48"
in49 :: Pattern Double
in49 :: Pattern Double
in49 = Double -> String -> Pattern Double
cF Double
0 String
"49"
in50 :: Pattern Double
in50 :: Pattern Double
in50 = Double -> String -> Pattern Double
cF Double
0 String
"50"
in51 :: Pattern Double
in51 :: Pattern Double
in51 = Double -> String -> Pattern Double
cF Double
0 String
"51"
in52 :: Pattern Double
in52 :: Pattern Double
in52 = Double -> String -> Pattern Double
cF Double
0 String
"52"
in53 :: Pattern Double
in53 :: Pattern Double
in53 = Double -> String -> Pattern Double
cF Double
0 String
"53"
in54 :: Pattern Double
in54 :: Pattern Double
in54 = Double -> String -> Pattern Double
cF Double
0 String
"54"
in55 :: Pattern Double
in55 :: Pattern Double
in55 = Double -> String -> Pattern Double
cF Double
0 String
"55"
in56 :: Pattern Double
in56 :: Pattern Double
in56 = Double -> String -> Pattern Double
cF Double
0 String
"56"
in57 :: Pattern Double
in57 :: Pattern Double
in57 = Double -> String -> Pattern Double
cF Double
0 String
"57"
in58 :: Pattern Double
in58 :: Pattern Double
in58 = Double -> String -> Pattern Double
cF Double
0 String
"58"
in59 :: Pattern Double
in59 :: Pattern Double
in59 = Double -> String -> Pattern Double
cF Double
0 String
"59"
in60 :: Pattern Double
in60 :: Pattern Double
in60 = Double -> String -> Pattern Double
cF Double
0 String
"60"
in61 :: Pattern Double
in61 :: Pattern Double
in61 = Double -> String -> Pattern Double
cF Double
0 String
"61"
in62 :: Pattern Double
in62 :: Pattern Double
in62 = Double -> String -> Pattern Double
cF Double
0 String
"62"
in63 :: Pattern Double
in63 :: Pattern Double
in63 = Double -> String -> Pattern Double
cF Double
0 String
"63"
in64 :: Pattern Double
in64 :: Pattern Double
in64 = Double -> String -> Pattern Double
cF Double
0 String
"64"
in65 :: Pattern Double
in65 :: Pattern Double
in65 = Double -> String -> Pattern Double
cF Double
0 String
"65"
in66 :: Pattern Double
in66 :: Pattern Double
in66 = Double -> String -> Pattern Double
cF Double
0 String
"66"
in67 :: Pattern Double
in67 :: Pattern Double
in67 = Double -> String -> Pattern Double
cF Double
0 String
"67"
in68 :: Pattern Double
in68 :: Pattern Double
in68 = Double -> String -> Pattern Double
cF Double
0 String
"68"
in69 :: Pattern Double
in69 :: Pattern Double
in69 = Double -> String -> Pattern Double
cF Double
0 String
"69"
in70 :: Pattern Double
in70 :: Pattern Double
in70 = Double -> String -> Pattern Double
cF Double
0 String
"70"
in71 :: Pattern Double
in71 :: Pattern Double
in71 = Double -> String -> Pattern Double
cF Double
0 String
"71"
in72 :: Pattern Double
in72 :: Pattern Double
in72 = Double -> String -> Pattern Double
cF Double
0 String
"72"
in73 :: Pattern Double
in73 :: Pattern Double
in73 = Double -> String -> Pattern Double
cF Double
0 String
"73"
in74 :: Pattern Double
in74 :: Pattern Double
in74 = Double -> String -> Pattern Double
cF Double
0 String
"74"
in75 :: Pattern Double
in75 :: Pattern Double
in75 = Double -> String -> Pattern Double
cF Double
0 String
"75"
in76 :: Pattern Double
in76 :: Pattern Double
in76 = Double -> String -> Pattern Double
cF Double
0 String
"76"
in77 :: Pattern Double
in77 :: Pattern Double
in77 = Double -> String -> Pattern Double
cF Double
0 String
"77"
in78 :: Pattern Double
in78 :: Pattern Double
in78 = Double -> String -> Pattern Double
cF Double
0 String
"78"
in79 :: Pattern Double
in79 :: Pattern Double
in79 = Double -> String -> Pattern Double
cF Double
0 String
"79"
in80 :: Pattern Double
in80 :: Pattern Double
in80 = Double -> String -> Pattern Double
cF Double
0 String
"80"
in81 :: Pattern Double
in81 :: Pattern Double
in81 = Double -> String -> Pattern Double
cF Double
0 String
"81"
in82 :: Pattern Double
in82 :: Pattern Double
in82 = Double -> String -> Pattern Double
cF Double
0 String
"82"
in83 :: Pattern Double
in83 :: Pattern Double
in83 = Double -> String -> Pattern Double
cF Double
0 String
"83"
in84 :: Pattern Double
in84 :: Pattern Double
in84 = Double -> String -> Pattern Double
cF Double
0 String
"84"
in85 :: Pattern Double
in85 :: Pattern Double
in85 = Double -> String -> Pattern Double
cF Double
0 String
"85"
in86 :: Pattern Double
in86 :: Pattern Double
in86 = Double -> String -> Pattern Double
cF Double
0 String
"86"
in87 :: Pattern Double
in87 :: Pattern Double
in87 = Double -> String -> Pattern Double
cF Double
0 String
"87"
in88 :: Pattern Double
in88 :: Pattern Double
in88 = Double -> String -> Pattern Double
cF Double
0 String
"88"
in89 :: Pattern Double
in89 :: Pattern Double
in89 = Double -> String -> Pattern Double
cF Double
0 String
"89"
in90 :: Pattern Double
in90 :: Pattern Double
in90 = Double -> String -> Pattern Double
cF Double
0 String
"90"
in91 :: Pattern Double
in91 :: Pattern Double
in91 = Double -> String -> Pattern Double
cF Double
0 String
"91"
in92 :: Pattern Double
in92 :: Pattern Double
in92 = Double -> String -> Pattern Double
cF Double
0 String
"92"
in93 :: Pattern Double
in93 :: Pattern Double
in93 = Double -> String -> Pattern Double
cF Double
0 String
"93"
in94 :: Pattern Double
in94 :: Pattern Double
in94 = Double -> String -> Pattern Double
cF Double
0 String
"94"
in95 :: Pattern Double
in95 :: Pattern Double
in95 = Double -> String -> Pattern Double
cF Double
0 String
"95"
in96 :: Pattern Double
in96 :: Pattern Double
in96 = Double -> String -> Pattern Double
cF Double
0 String
"96"
in97 :: Pattern Double
in97 :: Pattern Double
in97 = Double -> String -> Pattern Double
cF Double
0 String
"97"
in98 :: Pattern Double
in98 :: Pattern Double
in98 = Double -> String -> Pattern Double
cF Double
0 String
"98"
in99 :: Pattern Double
in99 :: Pattern Double
in99 = Double -> String -> Pattern Double
cF Double
0 String
"99"
in100 :: Pattern Double
in100 :: Pattern Double
in100 = Double -> String -> Pattern Double
cF Double
0 String
"100"
in101 :: Pattern Double
in101 :: Pattern Double
in101 = Double -> String -> Pattern Double
cF Double
0 String
"101"
in102 :: Pattern Double
in102 :: Pattern Double
in102 = Double -> String -> Pattern Double
cF Double
0 String
"102"
in103 :: Pattern Double
in103 :: Pattern Double
in103 = Double -> String -> Pattern Double
cF Double
0 String
"103"
in104 :: Pattern Double
in104 :: Pattern Double
in104 = Double -> String -> Pattern Double
cF Double
0 String
"104"
in105 :: Pattern Double
in105 :: Pattern Double
in105 = Double -> String -> Pattern Double
cF Double
0 String
"105"
in106 :: Pattern Double
in106 :: Pattern Double
in106 = Double -> String -> Pattern Double
cF Double
0 String
"106"
in107 :: Pattern Double
in107 :: Pattern Double
in107 = Double -> String -> Pattern Double
cF Double
0 String
"107"
in108 :: Pattern Double
in108 :: Pattern Double
in108 = Double -> String -> Pattern Double
cF Double
0 String
"108"
in109 :: Pattern Double
in109 :: Pattern Double
in109 = Double -> String -> Pattern Double
cF Double
0 String
"109"
in110 :: Pattern Double
in110 :: Pattern Double
in110 = Double -> String -> Pattern Double
cF Double
0 String
"110"
in111 :: Pattern Double
in111 :: Pattern Double
in111 = Double -> String -> Pattern Double
cF Double
0 String
"111"
in112 :: Pattern Double
in112 :: Pattern Double
in112 = Double -> String -> Pattern Double
cF Double
0 String
"112"
in113 :: Pattern Double
in113 :: Pattern Double
in113 = Double -> String -> Pattern Double
cF Double
0 String
"113"
in114 :: Pattern Double
in114 :: Pattern Double
in114 = Double -> String -> Pattern Double
cF Double
0 String
"114"
in115 :: Pattern Double
in115 :: Pattern Double
in115 = Double -> String -> Pattern Double
cF Double
0 String
"115"
in116 :: Pattern Double
in116 :: Pattern Double
in116 = Double -> String -> Pattern Double
cF Double
0 String
"116"
in117 :: Pattern Double
in117 :: Pattern Double
in117 = Double -> String -> Pattern Double
cF Double
0 String
"117"
in118 :: Pattern Double
in118 :: Pattern Double
in118 = Double -> String -> Pattern Double
cF Double
0 String
"118"
in119 :: Pattern Double
in119 :: Pattern Double
in119 = Double -> String -> Pattern Double
cF Double
0 String
"119"
in120 :: Pattern Double
in120 :: Pattern Double
in120 = Double -> String -> Pattern Double
cF Double
0 String
"120"
in121 :: Pattern Double
in121 :: Pattern Double
in121 = Double -> String -> Pattern Double
cF Double
0 String
"121"
in122 :: Pattern Double
in122 :: Pattern Double
in122 = Double -> String -> Pattern Double
cF Double
0 String
"122"
in123 :: Pattern Double
in123 :: Pattern Double
in123 = Double -> String -> Pattern Double
cF Double
0 String
"123"
in124 :: Pattern Double
in124 :: Pattern Double
in124 = Double -> String -> Pattern Double
cF Double
0 String
"124"
in125 :: Pattern Double
in125 :: Pattern Double
in125 = Double -> String -> Pattern Double
cF Double
0 String
"125"
in126 :: Pattern Double
in126 :: Pattern Double
in126 = Double -> String -> Pattern Double
cF Double
0 String
"126"
in127 :: Pattern Double
in127 :: Pattern Double
in127 = Double -> String -> Pattern Double
cF Double
0 String
"127"