Copyright | (c) Hans Hoglund 2012-2014 |
---|---|
License | BSD-style |
Maintainer | hans@hanshoglund.se |
Stability | experimental |
Portability | non-portable (TF,GNTD) |
Safe Haskell | None |
Language | Haskell2010 |
Provides functions for manipulating parts.
- type family Part s :: *
- type family SetPart b s :: *
- class (Transformable (Part s), Transformable (Part t)) => HasParts s t where
- class HasParts s t => HasPart s t where
- type HasPart' a = HasPart a a
- type HasParts' a = HasParts a a
- part' :: (HasPart s t, s ~ t) => Lens' s (Part s)
- parts' :: (HasParts s t, s ~ t) => Traversal' s (Part s)
- allParts :: (Ord (Part a), HasParts' a) => a -> [Part a]
- extracted :: (Ord (Part a), HasPart' a) => Iso (Score a) (Score b) [Score a] [Score b]
- extractedWithInfo :: (Ord (Part a), Ord (Part b), HasPart' a, HasPart' b) => Iso (Score a) (Score b) [(Part a, Score a)] [(Part b, Score b)]
- extractPart :: (Eq (Part a), HasPart' a) => Part a -> Score a -> Score a
- extractParts :: (Ord (Part a), HasPart' a) => Score a -> [Score a]
- extractPartsWithInfo :: (Ord (Part a), HasPart' a) => Score a -> [(Part a, Score a)]
- newtype PartT n a = PartT {
- getPartT :: (n, a)
- (</>) :: (HasParts' a, Enum (Part a)) => Score a -> Score a -> Score a
- rcat :: (HasParts' a, Enum (Part a)) => [Score a] -> Score a
Articulation type functions
type family Part s :: * Source
Parts type.
type Part Bool = Bool | |
type Part Float = Float | |
type Part Int = Int | |
type Part Integer = Integer | |
type Part Ordering = Ordering | |
type Part () = () | |
type Part [a] = Part a | |
type Part (Maybe a) = Part a | |
type Part (Note a) = Part a | |
type Part (Voice a) = Part a | |
type Part (Event a) = Part a | |
type Part (Score a) = Part a | |
type Part (Aligned a) = Part a | |
type Part (Behavior a) = Behavior (Part a) | |
type Part (Either c a) = Part a | |
type Part (c, a) = Part a | |
type Part (PartT p a) = p |
type family SetPart b s :: * Source
Part type.
type SetPart a Float = a | |
type SetPart a Integer = a | |
type SetPart a Int = a | |
type SetPart a () = a | |
type SetPart a Ordering = a | |
type SetPart a Bool = a | |
type SetPart g (Voice a) = Voice (SetPart g a) | |
type SetPart g (Score a) = Score (SetPart g a) | |
type SetPart g (Note a) = Note (SetPart g a) | |
type SetPart g (Event a) = Event (SetPart g a) | |
type SetPart b (Aligned a) = Aligned (SetPart b a) | |
type SetPart b (Maybe a) = Maybe (SetPart b a) | |
type SetPart b [a] = [SetPart b a] | |
type SetPart p' (PartT p a) = PartT p' a | |
type SetPart b (Either c a) = Either c (SetPart b a) | |
type SetPart b (c, a) = (c, SetPart b a) | |
type SetPart (Behavior g) (Behavior a) = Behavior (SetPart g a) |
Accessing parts
class (Transformable (Part s), Transformable (Part t)) => HasParts s t where Source
Class of types that provide a part traversal.
((~) * b (Part b), Transformable b) => HasParts Bool b | |
HasParts Float Float | |
HasParts Int Int | |
HasParts Integer Integer | |
((~) * b (Part b), Transformable b) => HasParts Ordering b | |
((~) * b (Part b), Transformable b) => HasParts () b | |
HasParts a b => HasParts [a] [b] | |
HasParts a b => HasParts (Maybe a) (Maybe b) | |
HasParts a b => HasParts (Note a) (Note b) | |
HasParts a b => HasParts (Voice a) (Voice b) | |
HasParts a b => HasParts (Event a) (Event b) | |
HasParts a b => HasParts (Score a) (Score b) | |
HasParts a b => HasParts (Aligned a) (Aligned b) | |
(HasPart a a, HasPart a b) => HasParts (Behavior a) (Behavior b) | |
HasParts a b => HasParts (Either c a) (Either c b) | |
HasParts a b => HasParts (c, a) (c, b) | |
(Transformable p, Transformable p') => HasParts (PartT p a) (PartT p' a) |
class HasParts s t => HasPart s t where Source
Class of types that provide a single part.
((~) * b (Part b), Transformable b) => HasPart Bool b | |
HasPart Float Float | |
HasPart Int Int | |
HasPart Integer Integer | |
((~) * b (Part b), Transformable b) => HasPart Ordering b | |
((~) * b (Part b), Transformable b) => HasPart () b | |
HasPart a b => HasPart (Note a) (Note b) | |
HasPart a b => HasPart (Event a) (Event b) | |
(HasPart a a, HasPart a b) => HasPart (Behavior a) (Behavior b) | |
HasPart a b => HasPart (c, a) (c, b) | |
(Transformable p, Transformable p') => HasPart (PartT p a) (PartT p' a) |
Listing parts
Extracting parts
extractedWithInfo :: (Ord (Part a), Ord (Part b), HasPart' a, HasPart' b) => Iso (Score a) (Score b) [(Part a, Score a)] [(Part b, Score b)] Source