Module

WAGS.Move

Package
purescript-wags
Repository
mikesol/purescript-wags

#Move Source

class Move (at :: Ptr) (from :: Type) (to :: Nat) (i :: Graph) (o :: Graph) | at from to i -> o where

Move an edge in an edge list for a given node. As an example, if we have a gain node with incoming edges 7,8,9, this can be used to move 7 to the end of the list so that we have 8,9,7. This is useful in conjunction with rebasing if two graphs are almost similar save their edge lists, which have a different order.

at - a ptr to the node whose edges we will move from - the edge we are moving - either an index (Nat) or audio unit ref to - the new position in the list i - the input universe o - the output universe

Members

Instances

#PtrListLen Source

class PtrListLen (i :: PtrList) (n :: Nat) | i -> n

Get the length of pointer list i as natural number n/

Instances

#MovePointer''' Source

class MovePointer''' (from :: Nat) (to :: Nat) (i :: PtrList) (o :: PtrList) | from to i -> o

Move a poitner from position from to position to in list i and return it as o.

Instances

#InsertIn Source

class InsertIn (fptr :: Ptr) (newTo :: Nat) (i' :: PtrList) (o :: PtrList) | fptr newTo i' -> o

Insert a poitner fptr at newTo in list i' and return it as o.

Instances

#RemoveAt Source

class RemoveAt (from :: Nat) (i :: PtrList) (fptr :: Ptr) (i' :: PtrList) | from i -> fptr i'

Remove whatever is at position from in list i, returning the removed fptr as well as the new pointer list i'.

Instances

#GetPtrIndex Source

class GetPtrIndex (found :: Type) (here :: Nat) (ptr :: Ptr) (i :: PtrList) (idx :: Nat) | found here ptr i -> idx

Tail recursive function to get assert that a pointer is at an index

  • found - the accumulator of whether we've found the pointer or not
  • here - the current index in the recursive function, starts at Z
  • ptr - the pointer we are looking for
  • i - the pointer list
  • idx - the index at which the pointer is found if it is found

Instances

#MovePointer'' Source

class MovePointer'' (from :: Type) (to :: Nat) (i :: PtrList) (o :: PtrList) | from to i -> o

Move a poitner from from, which is either a position or a reference to a value at an index, to position to in list i and return it as o.

Instances

#MovePointer' Source

class MovePointer' (from :: Type) (to :: Nat) (i :: EdgeProfile) (o :: EdgeProfile) | from to i -> o

Move from, which is either a position or a reference to a value at an index, to position to in edge profile i and return the edge profile as o.

Instances

#MovePointer Source

class MovePointer (at :: Ptr) (from :: Type) (to :: Nat) (i :: Node) (o :: Node) | at from to i -> o

Instances

#MovePointers Source

class MovePointers (at :: Ptr) (from :: Type) (to :: Nat) (i :: NodeList) (o :: NodeList) | at from to i -> o

At pointer at, move from, which is either a position or a reference to a value at an index, to position to in edge profile i and return the edge profile as o.

Instances