Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Gen a = Gen {}
- gPos :: forall a a. Lens (Gen a) (Gen a) a a
- gPol :: forall a. Lens' (Gen a) Polarity
- data Polarity
- power :: Integral a => Polarity -> a
- complement :: Polarity -> Polarity
- class (Integral a, Monoid (br a)) => Braid br a where
- newtype Artin a = Artin {}
- aGens :: forall a a. Iso (Artin a) (Artin a) [Gen a] [Gen a]
- newtype MultiGen a = MultiGen {}
- data Step a
- mSteps :: forall a a. Iso (MultiGen a) (MultiGen a) [Step a] [Step a]
- insertWithS :: forall a. Integral a => (Polarity -> Polarity -> Polarity) -> Gen a -> Step a -> Step a
- insertS :: Integral a => Gen a -> Step a -> Step a
- lookupS :: Integral a => a -> Step a -> Maybe Polarity
- deleteS :: Integral a => a -> Step a -> Step a
- stepGens :: Integral a => Iso' (Step a) [Gen a]
- stepToGens :: Integral a => Step a -> [Gen a]
- gensToStep :: Integral a => [Gen a] -> Step a
- data DimBraid b a = DimBraid {}
- dim :: Braid b a => b a -> DimBraid b a
- dBraid :: forall b a b. Lens (DimBraid b a) (DimBraid b a) (b a) (b a)
- dSteps :: forall b a. Lens' (DimBraid b a) Int
- dStrands :: forall b a. Lens' (DimBraid b a) a
- type Weave a = (a, Polarity)
- class ToWeaves w a where
- data Strand a = Strand {}
- strand :: (Integral a, Braid b a) => a -> b a -> Strand a
- strand' :: Integral a => a -> [[Gen a]] -> Strand a
- strands :: (Integral a, Braid b a) => b a -> [Strand a]
- sWeaves :: forall a. Lens' (Strand a) [Weave a]
- sLast :: forall a. Lens' (Strand a) a
- newtype Loop a = Loop {}
- toLoops :: (Eq a, Show a) => [Strand a] -> [Loop a]
- lStrands :: forall a a. Iso (Loop a) (Loop a) [Strand a] [Strand a]
- data Move b i = Move (b i) (b i)
- inverse :: Move b i -> Move b i
- moveH :: Braid a i => Move a i -> i
- moveW :: Braid a i => Move a i -> Int
- data Loc a = Loc {}
- lx :: forall a. Lens' (Loc a) Int
- ly :: forall a a. Lens (Loc a) (Loc a) a a
Generators
Braid generator pairing position (absolute or relative) and polarity.
Braid generator "power", as (i + 1) "over/under" i. O[ver] == power 1 (i + 1 "over" i) U[nder] = power -1 (i + 1 "under" i)
complement :: Polarity -> Polarity Source #
Flip polarity.
Representations
class (Integral a, Monoid (br a)) => Braid br a where Source #
Braid representations.
stepCount :: br a -> Int Source #
Length, number of "steps"columnsartin generators.
strandCount :: br a -> a Source #
N, braid group index, number of strandsrows"i"s.
toGens :: br a -> [[Gen a]] Source #
Common format is br series of "steps" of absolute-indexed generators.
minIndex :: br a -> a Source #
Minimum index (i) value
maxIndex :: br a -> a Source #
Maximum index (i) value. Note this means values of (i+1) obtain, per generators.
invert :: br a -> br a Source #
Invert indices
toArtin :: br a -> Artin a Source #
convert to single-gen
toMultiGen :: br a -> MultiGen a Source #
convert to multi-gen
Braid as "Artin generators" (one-at-a-time).
Steps of many-at-a-time generators.
Braid "step" of many-at-a-time generators. Absolute-head-offset-tail structure disallows invalid adjacent generators. Example: 'Step (Gen 1 U) [Gen 0 O]' translates to [s1,s3^-1].
insertWithS :: forall a. Integral a => (Polarity -> Polarity -> Polarity) -> Gen a -> Step a -> Step a Source #
Insert a gen at absolute index into a Step
.
Ignores invalid indices, uses function with new, old value
for update.
insertS :: Integral a => Gen a -> Step a -> Step a Source #
Insert a gen at absolute index into a Step
.
Ignores invalid indices, overwrites on update.
gensToStep :: Integral a => [Gen a] -> Step a Source #
translate absolute-indexed gens to Step
.
Drops invalid values.
Braid with explicit dimensions (mainly for empty steps/strands)
Strands, loops, weaves
Concrete braid strand presentation as values delimited by polarities.
strand :: (Integral a, Braid b a) => a -> b a -> Strand a Source #
Extract a single strand from a braid.
Capture strands into a loop, where _sLast
of one strand
is the first value of the next.
Foldable instance ignores "last" values of strands (since they will equal the next head).
Moves/isotopy
A la Reidemeister.
Move (b i) (b i) |
Coordinate in braid.