Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- 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)
Instances
Enum Polarity Source # | |
Eq Polarity Source # | |
Ord Polarity Source # | |
Defined in Fadno.Braids.Internal | |
Show Polarity Source # | |
ToWeaves [Weave a] a Source # | |
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
Instances
Integral a => Braid Artin a Source # | |
Defined in Fadno.Braids.Internal | |
Integral a => Braid MultiGen a Source # | |
Defined in Fadno.Braids.Internal stepCount :: MultiGen a -> Int Source # strandCount :: MultiGen a -> a Source # toGens :: MultiGen a -> [[Gen a]] Source # minIndex :: MultiGen a -> a Source # maxIndex :: MultiGen a -> a Source # invert :: MultiGen a -> MultiGen a Source # toArtin :: MultiGen a -> Artin a Source # toMultiGen :: MultiGen a -> MultiGen a Source # | |
(Integral a, Braid b a) => Braid (DimBraid b) a Source # | |
Defined in Fadno.Braids.Internal stepCount :: DimBraid b a -> Int Source # strandCount :: DimBraid b a -> a Source # toGens :: DimBraid b a -> [[Gen a]] Source # minIndex :: DimBraid b a -> a Source # maxIndex :: DimBraid b a -> a Source # invert :: DimBraid b a -> DimBraid b a Source # toArtin :: DimBraid b a -> Artin a Source # toMultiGen :: DimBraid b a -> MultiGen a Source # |
Braid as "Artin generators" (one-at-a-time).
Instances
Functor Artin Source # | |
Foldable Artin Source # | |
Defined in Fadno.Braids.Internal fold :: Monoid m => Artin m -> m # foldMap :: Monoid m => (a -> m) -> Artin a -> m # foldr :: (a -> b -> b) -> b -> Artin a -> b # foldr' :: (a -> b -> b) -> b -> Artin a -> b # foldl :: (b -> a -> b) -> b -> Artin a -> b # foldl' :: (b -> a -> b) -> b -> Artin a -> b # foldr1 :: (a -> a -> a) -> Artin a -> a # foldl1 :: (a -> a -> a) -> Artin a -> a # elem :: Eq a => a -> Artin a -> Bool # maximum :: Ord a => Artin a -> a # minimum :: Ord a => Artin a -> a # | |
Integral a => Braid Artin a Source # | |
Defined in Fadno.Braids.Internal | |
Eq a => Eq (Artin a) Source # | |
Show a => Show (Artin a) Source # | |
Semigroup (Artin a) Source # | |
Monoid (Artin a) Source # | |
Steps of many-at-a-time generators.
Instances
Integral a => Braid MultiGen a Source # | |
Defined in Fadno.Braids.Internal stepCount :: MultiGen a -> Int Source # strandCount :: MultiGen a -> a Source # toGens :: MultiGen a -> [[Gen a]] Source # minIndex :: MultiGen a -> a Source # maxIndex :: MultiGen a -> a Source # invert :: MultiGen a -> MultiGen a Source # toArtin :: MultiGen a -> Artin a Source # toMultiGen :: MultiGen a -> MultiGen a Source # | |
Eq a => Eq (MultiGen a) Source # | |
Show a => Show (MultiGen a) Source # | |
Semigroup (MultiGen a) Source # | |
Monoid (MultiGen a) Source # | |
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].
Instances
Eq a => Eq (Step a) Source # | |
Show a => Show (Step a) Source # | |
Integral a => Semigroup (Step a) Source # | |
Integral a => Monoid (Step a) Source # | |
Integral a => Ixed (Step a) Source # | |
Defined in Fadno.Braids.Internal | |
type IxValue (Step a) Source # | |
Defined in Fadno.Braids.Internal | |
type Index (Step a) Source # | |
Defined in Fadno.Braids.Internal |
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)
Instances
(Integral a, Braid b a) => Braid (DimBraid b) a Source # | |
Defined in Fadno.Braids.Internal stepCount :: DimBraid b a -> Int Source # strandCount :: DimBraid b a -> a Source # toGens :: DimBraid b a -> [[Gen a]] Source # minIndex :: DimBraid b a -> a Source # maxIndex :: DimBraid b a -> a Source # invert :: DimBraid b a -> DimBraid b a Source # toArtin :: DimBraid b a -> Artin a Source # toMultiGen :: DimBraid b a -> MultiGen a Source # | |
(Eq a, Eq (b a)) => Eq (DimBraid b a) Source # | |
(Show a, Show (b a)) => Show (DimBraid b a) Source # | |
(Semigroup (b a), Integral a) => Semigroup (DimBraid b a) Source # | |
(Monoid (b a), Integral a) => Monoid (DimBraid b a) Source # | |
Strands, loops, weaves
class ToWeaves w a where Source #
Extract a list of weaves.
Concrete braid strand presentation as values delimited by polarities.
Instances
Functor Strand Source # | |
Foldable Strand Source # | |
Defined in Fadno.Braids.Internal fold :: Monoid m => Strand m -> m # foldMap :: Monoid m => (a -> m) -> Strand a -> m # foldr :: (a -> b -> b) -> b -> Strand a -> b # foldr' :: (a -> b -> b) -> b -> Strand a -> b # foldl :: (b -> a -> b) -> b -> Strand a -> b # foldl' :: (b -> a -> b) -> b -> Strand a -> b # foldr1 :: (a -> a -> a) -> Strand a -> a # foldl1 :: (a -> a -> a) -> Strand a -> a # elem :: Eq a => a -> Strand a -> Bool # maximum :: Ord a => Strand a -> a # minimum :: Ord a => Strand a -> a # | |
Traversable Strand Source # | |
Eq a => Eq (Strand a) Source # | |
Show a => Show (Strand a) Source # | |
ToWeaves (Strand a) a Source # | |
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).
Instances
Functor Loop Source # | |
Foldable Loop Source # | |
Defined in Fadno.Braids.Internal fold :: Monoid m => Loop m -> m # foldMap :: Monoid m => (a -> m) -> Loop a -> m # foldr :: (a -> b -> b) -> b -> Loop a -> b # foldr' :: (a -> b -> b) -> b -> Loop a -> b # foldl :: (b -> a -> b) -> b -> Loop a -> b # foldl' :: (b -> a -> b) -> b -> Loop a -> b # foldr1 :: (a -> a -> a) -> Loop a -> a # foldl1 :: (a -> a -> a) -> Loop a -> a # elem :: Eq a => a -> Loop a -> Bool # maximum :: Ord a => Loop a -> a # | |
Eq a => Eq (Loop a) Source # | |
Show a => Show (Loop a) Source # | |
Semigroup (Loop a) Source # | |
Monoid (Loop a) Source # | |
ToWeaves (Loop a) a Source # | |
Moves/isotopy
A la Reidemeister.
Move (b i) (b i) |