Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Solkattu.Solkattu

Description

Notation for Carnatic solkattu.

This is actually a separate library that's independent of the rest of the sequencer. The only connection is that its final output can be stroke names for some instrument and thus easily inserted into a track.

Solkattu is a general form of rhythmic notation. Since the syllables (sollus) are independent of any particular instrument, they can express general rhythmic structures, which can then be realized in a form idiomatic to different instruments.

The system is split up in a somewhat complicated way to separate rhythmic handling from sollus, and separate realizations sollus to various instruments. The structure from low to high level is:

Solkattu.Tala - General Tala.Tala type.

Solkattu.S - Generic rhythmic framework, where the "payload" note type is abstract. This can express rhythms in terms of S.Speed and S.TempoChange, check them against a Tala, and realize down to S.Duration tagged notes.

Solkattu.Solkattu - Fill in a Sequence's note with a Sollu type. This supports all of the notation in Solkattu.Dsl. As Sequence leaves the note type abstract, this leaves the instrument-dependent stroke type abstract.

Solkattu.Realize - This has an instrument-specific Stroke, which is the result of resolving the sollus. The stroke type is still abstract since it's polymorphic over the specific instrument.

Solkattu.Instrument.Mridangam, Solkattu.Instrument.KendangTunggal, etc. - These describe specific instruments for Realize.

Solkattu.Korvai - A Korvai unifies the instrument-specific Patterns and StrokeMaps together with Tala and a solkattu sequence. So I can support multiple instruments from one solkattu score, it merges the stroke types into a single type, and projects out the specific strokes depending on which instrument is being realized.

Solkattu.Dsl.Solkattu - Functions for creating solkattu scores. It defines (or replaces) various operators to make scores look nicer.

Solkattu.Score.Solkattu* - Instrument-independent korvais.

Solkattu.Dsl.Mridangam, Solkattu.Score.Mridangam* - These are similar to Dsl and Score.Solkattu*, except they use concrete mridangam strokes instead of abstract sollus.

The naming convention is that "Note" is the level-specific value, which may have a "Note" constructor with the "next level" of value. "SNote" is an alias for composing Note with Note, and "Sequence" is a newtype for a list of those, but is abstractly the monoid where you can put together notation to form a score.

Synopsis

Documentation

class (Show a, Pretty a) => Notation a where Source #

Render a concrete stroke to text representing it. This is used for ASCII output, so it should produce only a single character per matra duration. There could be exceptions for strokes which are both rare and almost always occur before a rest.

The Show and Pretty superclasses are to make debugging more convenient.

Minimal complete definition

notation

Methods

notation :: a -> (Styled.Style, Text) Source #

extension :: a -> Char Source #

Extend the note to fill its time with this character.

Instances

Instances details
Notation Degree Source # 
Instance details

Defined in Solkattu.Instrument.Sargam

Notation Pitch Source # 
Instance details

Defined in Solkattu.Instrument.Sargam

Notation Bol Source # 
Instance details

Defined in Solkattu.Bol

Notation Stroke Source # 
Instance details

Defined in Solkattu.Instrument.KendangPasang

Notation Stroke Source # 
Instance details

Defined in Solkattu.Instrument.KendangTunggal

Notation Stroke Source # 
Instance details

Defined in Solkattu.Instrument.Mridangam

Notation Thoppi Source # 
Instance details

Defined in Solkattu.Instrument.Mridangam

Notation Valantalai Source # 
Instance details

Defined in Solkattu.Instrument.Mridangam

Notation Stroke Source # 
Instance details

Defined in Solkattu.Instrument.Reyong

Notation Stroke Source # 
Instance details

Defined in Solkattu.Instrument.Sargam

Notation Pattern Source # 
Instance details

Defined in Solkattu.Solkattu

Notation Sollu Source # 
Instance details

Defined in Solkattu.Solkattu

Notation stroke => Notation (Note stroke) Source # 
Instance details

Defined in Solkattu.Realize

Methods

notation :: Note stroke -> (Styled.Style, Text) Source #

extension :: Note stroke -> Char Source #

Notation stroke => Notation (Stroke stroke) Source # 
Instance details

Defined in Solkattu.Realize

Methods

notation :: Stroke stroke -> (Styled.Style, Text) Source #

extension :: Stroke stroke -> Char Source #

data Note sollu Source #

Instances

Instances details
Foldable Note Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

fold :: Monoid m => Note m -> m #

foldMap :: Monoid m => (a -> m) -> Note a -> m #

foldMap' :: Monoid m => (a -> m) -> Note a -> m #

foldr :: (a -> b -> b) -> b -> Note a -> b #

foldr' :: (a -> b -> b) -> b -> Note a -> b #

foldl :: (b -> a -> b) -> b -> Note a -> b #

foldl' :: (b -> a -> b) -> b -> Note a -> b #

foldr1 :: (a -> a -> a) -> Note a -> a #

foldl1 :: (a -> a -> a) -> Note a -> a #

toList :: Note a -> [a] #

null :: Note a -> Bool #

length :: Note a -> Int #

elem :: Eq a => a -> Note a -> Bool #

maximum :: Ord a => Note a -> a #

minimum :: Ord a => Note a -> a #

sum :: Num a => Note a -> a #

product :: Num a => Note a -> a #

IsString Sequence Source # 
Instance details

Defined in Solkattu.Dsl.Bol

IsString Sequence Source # 
Instance details

Defined in Solkattu.Dsl.Solkattu

IsString SequenceM Source # 
Instance details

Defined in Solkattu.Dsl.Solkattu

Traversable Note Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

traverse :: Applicative f => (a -> f b) -> Note a -> f (Note b) #

sequenceA :: Applicative f => Note (f a) -> f (Note a) #

mapM :: Monad m => (a -> m b) -> Note a -> m (Note b) #

sequence :: Monad m => Note (m a) -> m (Note a) #

Functor Note Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

fmap :: (a -> b) -> Note a -> Note b #

(<$) :: a -> Note b -> Note a #

Show sollu => Show (Note sollu) Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

showsPrec :: Int -> Note sollu -> ShowS #

show :: Note sollu -> String #

showList :: [Note sollu] -> ShowS #

Eq sollu => Eq (Note sollu) Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

(==) :: Note sollu -> Note sollu -> Bool #

(/=) :: Note sollu -> Note sollu -> Bool #

Ord sollu => Ord (Note sollu) Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

compare :: Note sollu -> Note sollu -> Ordering #

(<) :: Note sollu -> Note sollu -> Bool #

(<=) :: Note sollu -> Note sollu -> Bool #

(>) :: Note sollu -> Note sollu -> Bool #

(>=) :: Note sollu -> Note sollu -> Bool #

max :: Note sollu -> Note sollu -> Note sollu #

min :: Note sollu -> Note sollu -> Note sollu #

Rest (SequenceT sollu) Source # 
Instance details

Defined in Solkattu.Dsl.Notation

Methods

__ :: SequenceT sollu Source #

Rest (Note sollu) Source # 
Instance details

Defined in Solkattu.Dsl.Notation

Methods

__ :: Note sollu Source #

S.HasMatras (Note sollu) Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

matrasOf :: Note sollu -> S.Matra Source #

hasSustain :: Note sollu -> Bool Source #

Pretty sollu => Pretty (Note sollu) Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

pretty :: Note sollu -> Text Source #

format :: Note sollu -> Doc Source #

formatList :: [Note sollu] -> Doc Source #

data Group Source #

A Group is metadata stored alongside the nested sollus, but the actual nesting happens in S.Group. See NOTE [nested-groups] for how I arrived at the design.

Constructors

GReduction !Reduction 
GMeta !Meta 

Instances

Instances details
IsString Sequence Source # 
Instance details

Defined in Solkattu.Dsl.Bol

IsString Sequence Source # 
Instance details

Defined in Solkattu.Dsl.Solkattu

IsString SequenceM Source # 
Instance details

Defined in Solkattu.Dsl.Solkattu

Show Group Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

showsPrec :: Int -> Group -> ShowS #

show :: Group -> String #

showList :: [Group] -> ShowS #

Eq Group Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

(==) :: Group -> Group -> Bool #

(/=) :: Group -> Group -> Bool #

Ord Group Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

compare :: Group -> Group -> Ordering #

(<) :: Group -> Group -> Bool #

(<=) :: Group -> Group -> Bool #

(>) :: Group -> Group -> Bool #

(>=) :: Group -> Group -> Bool #

max :: Group -> Group -> Group #

min :: Group -> Group -> Group #

Pretty Group Source # 
Instance details

Defined in Solkattu.Solkattu

Rest (SequenceT sollu) Source # 
Instance details

Defined in Solkattu.Dsl.Notation

Methods

__ :: SequenceT sollu Source #

data Reduction Source #

Constructors

Reduction 

Fields

Instances

Instances details
Show Reduction Source # 
Instance details

Defined in Solkattu.Solkattu

Eq Reduction Source # 
Instance details

Defined in Solkattu.Solkattu

Ord Reduction Source # 
Instance details

Defined in Solkattu.Solkattu

Pretty Reduction Source # 
Instance details

Defined in Solkattu.Solkattu

data Meta Source #

Constructors

Meta 

Fields

  • _matras :: !(Maybe S.Matra)

    This is the logical number of Matras the group has. It has to be stored because the number of matras is only accurate relative to the tempo context. For GSarva, this actually defines the duration, which is pretty unfortunate. See flatDuration.

  • _name :: !(Maybe Text)

    Normally name is derived from _matras and _type, but some groups want to override that.

  • _type :: !GroupType

    This determines abstraction level and color highlight in the score.

Instances

Instances details
Show Meta Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

showsPrec :: Int -> Meta -> ShowS #

show :: Meta -> String #

showList :: [Meta] -> ShowS #

Eq Meta Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

(==) :: Meta -> Meta -> Bool #

(/=) :: Meta -> Meta -> Bool #

Ord Meta Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

compare :: Meta -> Meta -> Ordering #

(<) :: Meta -> Meta -> Bool #

(<=) :: Meta -> Meta -> Bool #

(>) :: Meta -> Meta -> Bool #

(>=) :: Meta -> Meta -> Bool #

max :: Meta -> Meta -> Meta #

min :: Meta -> Meta -> Meta #

Pretty Meta Source # 
Instance details

Defined in Solkattu.Solkattu

data GroupType Source #

Constructors

GGroup

A generic group, usually manually applied.

GReductionT

Reductions get this automatically.

GFiller

A bit of decorative filler, should be highlighted subtly if at all.

GPattern

A realized Note.

GExplicitPattern

A pattern with sollus already given.

GSarva 
GCheckDuration !S.Duration

Check that this group has the duration in _matras. This group type should be stripped out after the check.

Instances

Instances details
Show GroupType Source # 
Instance details

Defined in Solkattu.Solkattu

Eq GroupType Source # 
Instance details

Defined in Solkattu.Solkattu

Ord GroupType Source # 
Instance details

Defined in Solkattu.Solkattu

Pretty GroupType Source # 
Instance details

Defined in Solkattu.Solkattu

groupTypes :: [GroupType] Source #

All GroupTypes that should be seen by render. GCheckDuration should have been removed by checkDuration. I could express that in the type, but it seems too noisy for now.

data Side Source #

Before means drop the strokes before the _split split, After means drop the ones after.

Constructors

Before 
After 

Instances

Instances details
Show Side Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

showsPrec :: Int -> Side -> ShowS #

show :: Side -> String #

showList :: [Side] -> ShowS #

Eq Side Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

(==) :: Side -> Side -> Bool #

(/=) :: Side -> Side -> Bool #

Ord Side Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

compare :: Side -> Side -> Ordering #

(<) :: Side -> Side -> Bool #

(<=) :: Side -> Side -> Bool #

(>) :: Side -> Side -> Bool #

(>=) :: Side -> Side -> Bool #

max :: Side -> Side -> Side #

min :: Side -> Side -> Side #

Pretty Side Source # 
Instance details

Defined in Solkattu.Solkattu

data Space Source #

A note that can take up a variable amount of space. Since it doesn't have set strokes (or any, in the case of Rest), it can be arbitrarily divided.

Constructors

Rest 
Offset

This is not actual rest time in the performance, but inserted in the score for a start offset.

Instances

Instances details
Show Space Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

showsPrec :: Int -> Space -> ShowS #

show :: Space -> String #

showList :: [Space] -> ShowS #

Eq Space Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

(==) :: Space -> Space -> Bool #

(/=) :: Space -> Space -> Bool #

Ord Space Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

compare :: Space -> Space -> Ordering #

(<) :: Space -> Space -> Bool #

(<=) :: Space -> Space -> Bool #

(>) :: Space -> Space -> Bool #

(>=) :: Space -> Space -> Bool #

max :: Space -> Space -> Space #

min :: Space -> Space -> Space #

Pretty Space Source # 
Instance details

Defined in Solkattu.Solkattu

data NoteT sollu Source #

Constructors

NoteT 

Fields

  • _sollu :: !sollu
     
  • _karvai :: !Bool

    If it's a karvai sollu, and it's followed by a rest, it will replace the rest. Otherwise, it will be replaced by a note.

  • _tag :: !(Maybe Tag)

    Tag a sequence for alternate realization.

Instances

Instances details
Foldable NoteT Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

fold :: Monoid m => NoteT m -> m #

foldMap :: Monoid m => (a -> m) -> NoteT a -> m #

foldMap' :: Monoid m => (a -> m) -> NoteT a -> m #

foldr :: (a -> b -> b) -> b -> NoteT a -> b #

foldr' :: (a -> b -> b) -> b -> NoteT a -> b #

foldl :: (b -> a -> b) -> b -> NoteT a -> b #

foldl' :: (b -> a -> b) -> b -> NoteT a -> b #

foldr1 :: (a -> a -> a) -> NoteT a -> a #

foldl1 :: (a -> a -> a) -> NoteT a -> a #

toList :: NoteT a -> [a] #

null :: NoteT a -> Bool #

length :: NoteT a -> Int #

elem :: Eq a => a -> NoteT a -> Bool #

maximum :: Ord a => NoteT a -> a #

minimum :: Ord a => NoteT a -> a #

sum :: Num a => NoteT a -> a #

product :: Num a => NoteT a -> a #

Traversable NoteT Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

traverse :: Applicative f => (a -> f b) -> NoteT a -> f (NoteT b) #

sequenceA :: Applicative f => NoteT (f a) -> f (NoteT a) #

mapM :: Monad m => (a -> m b) -> NoteT a -> m (NoteT b) #

sequence :: Monad m => NoteT (m a) -> m (NoteT a) #

Functor NoteT Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

fmap :: (a -> b) -> NoteT a -> NoteT b #

(<$) :: a -> NoteT b -> NoteT a #

Show sollu => Show (NoteT sollu) Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

showsPrec :: Int -> NoteT sollu -> ShowS #

show :: NoteT sollu -> String #

showList :: [NoteT sollu] -> ShowS #

Eq sollu => Eq (NoteT sollu) Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

(==) :: NoteT sollu -> NoteT sollu -> Bool #

(/=) :: NoteT sollu -> NoteT sollu -> Bool #

Ord sollu => Ord (NoteT sollu) Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

compare :: NoteT sollu -> NoteT sollu -> Ordering #

(<) :: NoteT sollu -> NoteT sollu -> Bool #

(<=) :: NoteT sollu -> NoteT sollu -> Bool #

(>) :: NoteT sollu -> NoteT sollu -> Bool #

(>=) :: NoteT sollu -> NoteT sollu -> Bool #

max :: NoteT sollu -> NoteT sollu -> NoteT sollu #

min :: NoteT sollu -> NoteT sollu -> NoteT sollu #

Pretty sollu => Pretty (NoteT sollu) Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

pretty :: NoteT sollu -> Text Source #

format :: NoteT sollu -> Doc Source #

formatList :: [NoteT sollu] -> Doc Source #

data Tag Source #

A sollu can have a tag attached. This is used to map certain sets of sollus to a different realization. The idea is that even though the sollus are the same, they may be realized different ways in different contexts.

Constructors

Tag !Int 
Middle

Marks the middle karvai in a tirmanam. This is applied automatically, so it can have an alternate realization.

Standard

Marks a standard pattern. This isolates the "standard pattern" use of common sollus like taka.

Instances

Instances details
Num Tag Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

(+) :: Tag -> Tag -> Tag #

(-) :: Tag -> Tag -> Tag #

(*) :: Tag -> Tag -> Tag #

negate :: Tag -> Tag #

abs :: Tag -> Tag #

signum :: Tag -> Tag #

fromInteger :: Integer -> Tag #

Show Tag Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

showsPrec :: Int -> Tag -> ShowS #

show :: Tag -> String #

showList :: [Tag] -> ShowS #

Eq Tag Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

(==) :: Tag -> Tag -> Bool #

(/=) :: Tag -> Tag -> Bool #

Ord Tag Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

compare :: Tag -> Tag -> Ordering #

(<) :: Tag -> Tag -> Bool #

(<=) :: Tag -> Tag -> Bool #

(>) :: Tag -> Tag -> Bool #

(>=) :: Tag -> Tag -> Bool #

max :: Tag -> Tag -> Tag #

min :: Tag -> Tag -> Tag #

Pretty Tag Source # 
Instance details

Defined in Solkattu.Solkattu

note :: sollu -> NoteT sollu Source #

noteOf :: Note sollu -> Maybe (NoteT sollu) Source #

solluOf :: Note sollu -> Maybe sollu Source #

modifyNote :: (NoteT a -> NoteT b) -> Note a -> Note b Source #

newtype Pattern Source #

Constructors

PatternM S.Matra 

Instances

Instances details
Show Pattern Source # 
Instance details

Defined in Solkattu.Solkattu

Eq Pattern Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

(==) :: Pattern -> Pattern -> Bool #

(/=) :: Pattern -> Pattern -> Bool #

Ord Pattern Source # 
Instance details

Defined in Solkattu.Solkattu

Expr.ToExpr Pattern Source # 
Instance details

Defined in Solkattu.Solkattu

S.HasMatras Pattern Source # 
Instance details

Defined in Solkattu.Solkattu

Notation Pattern Source # 
Instance details

Defined in Solkattu.Solkattu

Pretty Pattern Source # 
Instance details

Defined in Solkattu.Solkattu

data Karvai Source #

Constructors

Karvai 
NotKarvai 

Instances

Instances details
Show Karvai Source # 
Instance details

Defined in Solkattu.Solkattu

Eq Karvai Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

(==) :: Karvai -> Karvai -> Bool #

(/=) :: Karvai -> Karvai -> Bool #

Ord Karvai Source # 
Instance details

Defined in Solkattu.Solkattu

data Sollu Source #

Constructors

NoSollu

a dummy sollu for rests in Konnakol

Cham 
Dheem 
Dhom 
Di 
Dim 
Din 
Dit 
Du 
Ga 
Gin 
Gu 
Jo 
Ka 
Ki 
Ku 
Kum 
Lang 
Mi 
Na 
Nam 
Nang 
Nu 
Ri 
Ta 
Tam 
Tang 
Tong 
Tat 
Tha 
Thom 
Ti 

Instances

Instances details
IsString Sequence Source # 
Instance details

Defined in Solkattu.Dsl.Solkattu

Bounded Sollu Source # 
Instance details

Defined in Solkattu.Solkattu

Enum Sollu Source # 
Instance details

Defined in Solkattu.Solkattu

Show Sollu Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

showsPrec :: Int -> Sollu -> ShowS #

show :: Sollu -> String #

showList :: [Sollu] -> ShowS #

Eq Sollu Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

(==) :: Sollu -> Sollu -> Bool #

(/=) :: Sollu -> Sollu -> Bool #

Ord Sollu Source # 
Instance details

Defined in Solkattu.Solkattu

Methods

compare :: Sollu -> Sollu -> Ordering #

(<) :: Sollu -> Sollu -> Bool #

(<=) :: Sollu -> Sollu -> Bool #

(>) :: Sollu -> Sollu -> Bool #

(>=) :: Sollu -> Sollu -> Bool #

max :: Sollu -> Sollu -> Sollu #

min :: Sollu -> Sollu -> Sollu #

Expr.ToExpr Sollu Source # 
Instance details

Defined in Solkattu.Instrument.Konnakol

Notation Sollu Source # 
Instance details

Defined in Solkattu.Solkattu

Pretty Sollu Source # 
Instance details

Defined in Solkattu.Solkattu

Expr.ToExpr (Stroke Sollu) Source # 
Instance details

Defined in Solkattu.Instrument.Konnakol

parseSollus

parseSyllables :: Show sollu => [(Text, sollu)] -> Text -> Either Error [Maybe sollu] Source #

parseSyllablesWord :: [(Text, sollu)] -> Text -> [[Maybe sollu]] Source #

durations

_durationOf :: (S.HasMatras a, Num dur, Ord dur) => (S.Tempo -> S.Duration -> dur) -> S.Tempo -> S.Sequence Group a -> dur Source #

flatDuration :: S.HasMatras a => S.Flat Group a -> S.Duration Source #

Unfortunately, with Reduction and GSarva groups, the notes don't reflect the actual durations, so for Group-bearing S.Flat, I need a special function. I tried really hard to prevent this but failed. The sollus have to go in the note field, and with reductions and sarva, they no longer correspond exactly to realized strokes. I would have to two note slots, one for a space-filling Group FMatras, and another for the sollus, but since groups can be nested, it gets really head-hurting for my tiny brain.

See NOTE [nested-groups] for chaotic details.

functions

cancelKarvai :: [S.Flat g (Note sollu)] -> [S.Flat g (Note sollu)] Source #

A Karvai Note followed by a Space will replace the rest, if followed by a Note or Pattern, the Karvai will be dropped. Since a Karvai note logically has no duration, if it's the last note it will be dropped

vary

vary Source #

Arguments

:: (S.Matra -> Variations)

variations allowed for this duration

-> S.Sequence g (Note sollu) 
-> [S.Sequence g (Note sollu)] 

Variation means replacing a triad of patterns of the same duration with a an increasing or decreasing sequence. For instance, 666 can become 567, 765, or 777 can become 678 or 579 or their inverses.

TODO Variation on a higher order is also possible, so for instance 777, 777, 777 may become 666, 777, 888

TODO Also we have 5, 55, 555 -> 55, 55, 55 -> 555, 55, 5. This actually applies to more than just Patterns, e.g. 3 as tadin_. I think this is orthogonal and could get a different function.

findTriads :: S.Sequence g (Note sollu) -> [(S.Matra, (Int, Int, Int))] Source #

Find triples of Patterns with the same length and return their indices. The indices are in ascending order.

exceptions

newtype Exception Source #

Yes, I use impure exceptions, because otherwise the DSL has to become monadic or at least applicative. But it seems less egregious because there isn't such a strong distinction between compiling and running anyway.

But it does mean I have to be careful to force and catch at the boundaries.

Constructors

Exception Text 

util

applyModifications Source #

Arguments

:: (a -> mod -> a) 
-> [(Int, mod)]

modifications along with their indices, in ascending order

-> [a] 
-> [a] 

permuteFst :: (a -> [b]) -> [(a, x)] -> [[(b, x)]] Source #