most string funcs generic/doced
This commit is contained in:
parent
058b019ccd
commit
14ec3b727e
@ -126,12 +126,12 @@ instructionFloatEq = instructionEq float
|
|||||||
instructionFloatStackDepth :: State -> State
|
instructionFloatStackDepth :: State -> State
|
||||||
instructionFloatStackDepth = instructionStackDepth float
|
instructionFloatStackDepth = instructionStackDepth float
|
||||||
|
|
||||||
-- |Moves an item from deep within the float stack to the top of the float stack based on
|
-- |Copies an item from deep within the float stack to the top of the float stack based on
|
||||||
-- the top int from the int stack.
|
-- the top int from the int stack.
|
||||||
instructionFloatYankDup :: State -> State
|
instructionFloatYankDup :: State -> State
|
||||||
instructionFloatYankDup = instructionYankDup float
|
instructionFloatYankDup = instructionYankDup float
|
||||||
|
|
||||||
-- |Copies an item from deep within the float stack to the top of the float stack based on
|
-- |Moves an item from deep within the float stack to the top of the float stack based on
|
||||||
-- the top int from the int stack.
|
-- the top int from the int stack.
|
||||||
instructionFloatYank :: State -> State
|
instructionFloatYank :: State -> State
|
||||||
instructionFloatYank = instructionYank float
|
instructionFloatYank = instructionYank float
|
||||||
|
@ -230,8 +230,8 @@ instructionShove :: Lens' State [a] -> State -> State
|
|||||||
instructionShove accessor state = instructionShoveDup accessor state & accessor .~ drop 1 (view accessor (instructionShoveDup accessor state ))
|
instructionShove accessor state = instructionShoveDup accessor state & accessor .~ drop 1 (view accessor (instructionShoveDup accessor state ))
|
||||||
|
|
||||||
-- |Concats two semigroupable items together based on a lens. Not char generic.
|
-- |Concats two semigroupable items together based on a lens. Not char generic.
|
||||||
instructionConcat :: Semigroup a => Lens' State [a] -> State -> State
|
instructionVectorConcat :: Semigroup a => Lens' State [a] -> State -> State
|
||||||
instructionConcat accessor state =
|
instructionVectorConcat accessor state =
|
||||||
case uncons (view accessor state) of
|
case uncons (view accessor state) of
|
||||||
Just (x1, x2:_) -> droppedState & accessor .~ (x1 <> x2) : view accessor droppedState
|
Just (x1, x2:_) -> droppedState & accessor .~ (x1 <> x2) : view accessor droppedState
|
||||||
_ -> state
|
_ -> state
|
||||||
@ -266,6 +266,8 @@ instructionVectorTakeN accessor state@(State {_int = i1 : is}) =
|
|||||||
_ -> state
|
_ -> state
|
||||||
instructionVectorTakeN _ state = state
|
instructionVectorTakeN _ state = state
|
||||||
|
|
||||||
|
-- |Takes the last N items from the first vector on the top of a vector stack and
|
||||||
|
-- pushes the result to said vector stack.
|
||||||
instructionVectorTakeRN :: Lens' State [[a]] -> State -> State
|
instructionVectorTakeRN :: Lens' State [[a]] -> State -> State
|
||||||
instructionVectorTakeRN accessor state@(State {_int = i1 : is}) =
|
instructionVectorTakeRN accessor state@(State {_int = i1 : is}) =
|
||||||
case uncons (view accessor state) of
|
case uncons (view accessor state) of
|
||||||
@ -372,6 +374,9 @@ instructionVectorDrop accessor state@(State {_int = i1 : is}) =
|
|||||||
_ -> state
|
_ -> state
|
||||||
instructionVectorDrop _ state = state
|
instructionVectorDrop _ state = state
|
||||||
|
|
||||||
|
-- |Based on a vector lens, drops the last N items from the top vector.
|
||||||
|
-- Pushes the result back to the vector stack. N is pulled from the top
|
||||||
|
-- of the int stack.
|
||||||
instructionVectorDropR :: Lens' State [[a]] -> State -> State
|
instructionVectorDropR :: Lens' State [[a]] -> State -> State
|
||||||
instructionVectorDropR accessor state@(State {_int = i1 : is}) =
|
instructionVectorDropR accessor state@(State {_int = i1 : is}) =
|
||||||
case uncons (view accessor state{_int = is}) of
|
case uncons (view accessor state{_int = is}) of
|
||||||
@ -538,8 +543,9 @@ instructionVectorReplaceVectorN accessor state@(State {_int = i1 : is}) = instru
|
|||||||
instructionVectorReplaceVectorN _ state = state
|
instructionVectorReplaceVectorN _ state = state
|
||||||
|
|
||||||
-- |Based on two lenses, one of a primitive type and the next of a vector type,
|
-- |Based on two lenses, one of a primitive type and the next of a vector type,
|
||||||
-- Removes all occurrences inside of the top vector from the vector stack where the top
|
-- Removes Maybe Int occurrences inside of the top vector from the vector stack where the top
|
||||||
-- item from the primitive stack equals a primitive inside of the vector stack.
|
-- item from the primitive stack equals a primitive inside of the vector stack. If Nothing is passed
|
||||||
|
-- rather than a Just Int, will remove all occurrences.
|
||||||
instructionVectorRemove :: Eq a => Lens' State [a] -> Lens' State [[a]] -> Maybe Int -> State -> State
|
instructionVectorRemove :: Eq a => Lens' State [a] -> Lens' State [[a]] -> Maybe Int -> State -> State
|
||||||
instructionVectorRemove primAccessor vectorAccessor amt state =
|
instructionVectorRemove primAccessor vectorAccessor amt state =
|
||||||
case (uncons (view vectorAccessor state), uncons (view primAccessor state)) of
|
case (uncons (view vectorAccessor state), uncons (view primAccessor state)) of
|
||||||
@ -549,11 +555,21 @@ instructionVectorRemove primAccessor vectorAccessor amt state =
|
|||||||
-- |Based on two lenses, one of a primitive type and the next of a vector type,
|
-- |Based on two lenses, one of a primitive type and the next of a vector type,
|
||||||
-- Removes N occurrences inside of the top vector from the vector stack where the top
|
-- Removes N occurrences inside of the top vector from the vector stack where the top
|
||||||
-- item from the primitive stack equals a primitive inside of the vector stack. N is pulled
|
-- item from the primitive stack equals a primitive inside of the vector stack. N is pulled
|
||||||
-- from the top of the int stack.
|
-- from the top of the int stack. Not to be confused with instructionVectorRemoveNth.
|
||||||
instructionVectorRemoveN :: Eq a => Lens' State [a] -> Lens' State [[a]] -> State -> State
|
instructionVectorRemoveN :: Eq a => Lens' State [a] -> Lens' State [[a]] -> State -> State
|
||||||
instructionVectorRemoveN primAccessor vectorAccessor state@(State {_int = i1 : is}) = instructionVectorRemove primAccessor vectorAccessor (Just i1) state{_int = is}
|
instructionVectorRemoveN primAccessor vectorAccessor state@(State {_int = i1 : is}) = instructionVectorRemove primAccessor vectorAccessor (Just i1) state{_int = is}
|
||||||
instructionVectorRemoveN _ _ state = state
|
instructionVectorRemoveN _ _ state = state
|
||||||
|
|
||||||
|
-- |Based on a vector lens. Removes the Nth index of the top vector of the passed
|
||||||
|
-- vector stack. N is pulled from the top of the int stack. Not to be confused with
|
||||||
|
-- instructionVectorRemoveN.
|
||||||
|
instructionVectorRemoveNth :: Lens' State [[a]] -> State -> State
|
||||||
|
instructionVectorRemoveNth accessor state@(State {_int = i1 : is}) =
|
||||||
|
case uncons (view accessor state{_int = is}) of
|
||||||
|
Just (v1, vs) -> state{_int = is} & accessor .~ (deleteAt (absNum i1 v1) v1 : vs)
|
||||||
|
_ -> state
|
||||||
|
instructionVectorRemoveNth _ state = state
|
||||||
|
|
||||||
-- |Based on a vector lens and the two vectors on top of said stack.
|
-- |Based on a vector lens and the two vectors on top of said stack.
|
||||||
-- Inside of the first vector, removes the number of instances specified
|
-- Inside of the first vector, removes the number of instances specified
|
||||||
-- by the Maybe Int parameter of the second vector. Nothing removes all instances.
|
-- by the Maybe Int parameter of the second vector. Nothing removes all instances.
|
||||||
|
@ -28,7 +28,7 @@ rstrip = reverse . lstrip . reverse
|
|||||||
|
|
||||||
-- |Concats the top two strings on the string stack and pushes the result.
|
-- |Concats the top two strings on the string stack and pushes the result.
|
||||||
instructionStringConcat :: State -> State
|
instructionStringConcat :: State -> State
|
||||||
instructionStringConcat = instructionConcat string
|
instructionStringConcat = instructionVectorConcat string
|
||||||
|
|
||||||
-- |Swaps the top two strings on the string stack.
|
-- |Swaps the top two strings on the string stack.
|
||||||
instructionStringSwap :: State -> State
|
instructionStringSwap :: State -> State
|
||||||
@ -243,84 +243,126 @@ instructionStringMakeEmpty = instructionVectorMakeEmpty string
|
|||||||
instructionStringIsEmptyString :: State -> State
|
instructionStringIsEmptyString :: State -> State
|
||||||
instructionStringIsEmptyString = instructionVectorIsEmpty string
|
instructionStringIsEmptyString = instructionVectorIsEmpty string
|
||||||
|
|
||||||
-- TODO: Make this generic
|
-- |Removes the Nth char from the top string of the string stack. N is pulled
|
||||||
|
-- from the top of the int stack.
|
||||||
instructionStringRemoveNth :: State -> State
|
instructionStringRemoveNth :: State -> State
|
||||||
instructionStringRemoveNth state@(State {_string = s1 : ss, _int = i1 : is}) = state{_string = deleteAt (absNum i1 s1) s1 : ss, _int = is}
|
instructionStringRemoveNth = instructionVectorRemoveNth string
|
||||||
instructionStringRemoveNth state = state
|
|
||||||
|
|
||||||
|
-- |Sets the Nth char from the top string of the string stack to the top char from
|
||||||
|
-- the char stack. N is pulled from the top of the int stack.
|
||||||
instructionStringSetNth :: State -> State
|
instructionStringSetNth :: State -> State
|
||||||
instructionStringSetNth = instructionVectorSetNth char string
|
instructionStringSetNth = instructionVectorSetNth char string
|
||||||
|
|
||||||
|
-- |Strips the whitespace of the top string on the string stack and pushes the result
|
||||||
|
-- back to the string stack.
|
||||||
instructionStringStripWhitespace :: State -> State
|
instructionStringStripWhitespace :: State -> State
|
||||||
instructionStringStripWhitespace state@(State {_string = s1 : ss}) = state{_string = strip s1 : ss}
|
instructionStringStripWhitespace state@(State {_string = s1 : ss}) = state{_string = strip s1 : ss}
|
||||||
instructionStringStripWhitespace state = state
|
instructionStringStripWhitespace state = state
|
||||||
|
|
||||||
instructionStringFromLens :: Show a => State -> Lens' State [a] -> State
|
-- |Utility Function: Casts a type based on a lens to a string. Pushes the result
|
||||||
instructionStringFromLens state@(State {_string = ss}) accessor =
|
-- to the string stack.
|
||||||
|
instructionStringFromLens :: Show a => Lens' State [a] -> State -> State
|
||||||
|
instructionStringFromLens accessor state@(State {_string = ss}) =
|
||||||
case uncons (view accessor state) of
|
case uncons (view accessor state) of
|
||||||
Nothing -> state
|
Nothing -> state
|
||||||
Just (x1,_) -> state{_string = show x1 : ss}
|
Just (x1,_) -> state{_string = show x1 : ss}
|
||||||
|
|
||||||
|
-- |Converts the top bool from the bool stack to a string. Pushes the result to
|
||||||
|
-- the string stack.
|
||||||
instructionStringFromBool :: State -> State
|
instructionStringFromBool :: State -> State
|
||||||
instructionStringFromBool state = instructionStringFromLens state bool
|
instructionStringFromBool = instructionStringFromLens bool
|
||||||
|
|
||||||
|
-- |Converts the top int from the int stack to a string. Pushes the result to
|
||||||
|
-- the string stack.
|
||||||
instructionStringFromInt :: State -> State
|
instructionStringFromInt :: State -> State
|
||||||
instructionStringFromInt state = instructionStringFromLens state int
|
instructionStringFromInt = instructionStringFromLens int
|
||||||
|
|
||||||
|
-- |Converts the top float from the float stack to a string. Pushes the result to
|
||||||
|
-- the string stack.
|
||||||
instructionStringFromFloat :: State -> State
|
instructionStringFromFloat :: State -> State
|
||||||
instructionStringFromFloat state = instructionStringFromLens state float
|
instructionStringFromFloat = instructionStringFromLens float
|
||||||
|
|
||||||
|
-- |Converts the top char from the char stack to a string. Pushes the result to
|
||||||
|
-- the string stack.
|
||||||
instructionStringFromChar :: State -> State
|
instructionStringFromChar :: State -> State
|
||||||
instructionStringFromChar state@(State {_string = ss, _char = c1 : cs}) = state{_string = [c1] : ss, _char = cs}
|
instructionStringFromChar state@(State {_string = ss, _char = c1 : cs}) = state{_string = [c1] : ss, _char = cs}
|
||||||
instructionStringFromChar state = state
|
instructionStringFromChar state = state
|
||||||
|
|
||||||
|
-- |Removes the top string from the string stack.
|
||||||
instructionStringPop :: State -> State
|
instructionStringPop :: State -> State
|
||||||
instructionStringPop = instructionPop string
|
instructionStringPop = instructionPop string
|
||||||
|
|
||||||
|
-- |Duplicates the top string on the string stack.
|
||||||
instructionStringDup :: State -> State
|
instructionStringDup :: State -> State
|
||||||
instructionStringDup = instructionDup string
|
instructionStringDup = instructionDup string
|
||||||
|
|
||||||
|
-- |Duplicates the top string on the string stack N times based off the top of the int stack.
|
||||||
instructionStringDupN :: State -> State
|
instructionStringDupN :: State -> State
|
||||||
instructionStringDupN = instructionDupN string
|
instructionStringDupN = instructionDupN string
|
||||||
|
|
||||||
|
-- |Rotates the top three strings on the string stack.
|
||||||
instructionStringRot :: State -> State
|
instructionStringRot :: State -> State
|
||||||
instructionStringRot = instructionRot string
|
instructionStringRot = instructionRot string
|
||||||
|
|
||||||
|
-- |Sets the string stack to []
|
||||||
instructionStringFlush :: State -> State
|
instructionStringFlush :: State -> State
|
||||||
instructionStringFlush = instructionFlush string
|
instructionStringFlush = instructionFlush string
|
||||||
|
|
||||||
|
-- |Checks to see if the top two strings are equal and pushes the result
|
||||||
|
-- to the bool stack.
|
||||||
instructionStringEq :: State -> State
|
instructionStringEq :: State -> State
|
||||||
instructionStringEq = instructionEq string
|
instructionStringEq = instructionEq string
|
||||||
|
|
||||||
|
-- |Calculates the size of the string stack and pushes the result
|
||||||
|
-- to the int stack.
|
||||||
instructionStringStackDepth :: State -> State
|
instructionStringStackDepth :: State -> State
|
||||||
instructionStringStackDepth = instructionStackDepth string
|
instructionStringStackDepth = instructionStackDepth string
|
||||||
|
|
||||||
|
-- |Moves an item from deep within the string stack to the top of the string stack based on
|
||||||
|
-- the top int from the int stack.
|
||||||
instructionStringYank :: State -> State
|
instructionStringYank :: State -> State
|
||||||
instructionStringYank = instructionYank string
|
instructionStringYank = instructionYank string
|
||||||
|
|
||||||
|
-- |Copies an item from deep within the string stack to the top of the string stack based on
|
||||||
|
-- the top int from the int stack.
|
||||||
instructionStringYankDup :: State -> State
|
instructionStringYankDup :: State -> State
|
||||||
instructionStringYankDup = instructionYankDup string
|
instructionStringYankDup = instructionYankDup string
|
||||||
|
|
||||||
|
-- |Pushes True to the bool stack if the string stack is empty. Pushes False otherwise.
|
||||||
instructionStringIsStackEmpty :: State -> State
|
instructionStringIsStackEmpty :: State -> State
|
||||||
instructionStringIsStackEmpty = instructionIsStackEmpty string
|
instructionStringIsStackEmpty = instructionIsStackEmpty string
|
||||||
|
|
||||||
|
-- |Moves an item from the top of the string stack to deep within the string stack based on
|
||||||
|
-- the top int from the int stack.
|
||||||
instructionStringShove :: State -> State
|
instructionStringShove :: State -> State
|
||||||
instructionStringShove = instructionShove string
|
instructionStringShove = instructionShove string
|
||||||
|
|
||||||
|
-- |Copies an item from the top of the string stack to deep within the string stack based on
|
||||||
|
-- the top int from the int stack.
|
||||||
instructionStringShoveDup :: State -> State
|
instructionStringShoveDup :: State -> State
|
||||||
instructionStringShoveDup = instructionShoveDup string
|
instructionStringShoveDup = instructionShoveDup string
|
||||||
|
|
||||||
|
-- |Sorts the top string on the string stack by their ascii value and pushes the result
|
||||||
|
-- back to the string stack.
|
||||||
instructionStringSort :: State -> State
|
instructionStringSort :: State -> State
|
||||||
instructionStringSort = instructionVectorSort string
|
instructionStringSort = instructionVectorSort string
|
||||||
|
|
||||||
|
-- |Sorts the top string on the string stack backwards by their ascii value and pushes the result
|
||||||
|
-- back to the string stack.
|
||||||
instructionStringSortReverse :: State -> State
|
instructionStringSortReverse :: State -> State
|
||||||
instructionStringSortReverse = instructionVectorSortReverse string
|
instructionStringSortReverse = instructionVectorSortReverse string
|
||||||
|
|
||||||
|
-- |Duplicate the top N items from the string stack based on the top int from the int stack.
|
||||||
instructionStringDupItems :: State -> State
|
instructionStringDupItems :: State -> State
|
||||||
instructionStringDupItems = instructionDupItems string
|
instructionStringDupItems = instructionDupItems string
|
||||||
|
|
||||||
|
-- |Takes the top string and splits its up into strings of size 1 and pushes all of those
|
||||||
|
-- strings back onto the string stack.
|
||||||
instructionStringParseToChar :: State -> State
|
instructionStringParseToChar :: State -> State
|
||||||
instructionStringParseToChar = instructionVectorParseToPrim string
|
instructionStringParseToChar = instructionVectorParseToPrim string
|
||||||
|
|
||||||
|
-- |Uses the top two ints from the top of the int stack to pull a sub string
|
||||||
|
-- from the top string on the string stack. Pushes the result back to the
|
||||||
|
-- string stack.
|
||||||
instructionStringSubString :: State -> State
|
instructionStringSubString :: State -> State
|
||||||
instructionStringSubString = instructionSubVector string
|
instructionStringSubString = instructionSubVector string
|
||||||
|
@ -4,13 +4,13 @@ import HushGP.State
|
|||||||
import HushGP.Instructions.GenericInstructions
|
import HushGP.Instructions.GenericInstructions
|
||||||
|
|
||||||
instructionVectorBoolConcat :: State -> State
|
instructionVectorBoolConcat :: State -> State
|
||||||
instructionVectorBoolConcat = instructionConcat vectorBool
|
instructionVectorBoolConcat = instructionVectorConcat vectorBool
|
||||||
|
|
||||||
instructionVectorBoolConj :: State -> State
|
instructionVectorBoolConj :: State -> State
|
||||||
instructionVectorBoolConj = instructionConj bool vectorBool
|
instructionVectorBoolConj = instructionVectorConj bool vectorBool
|
||||||
|
|
||||||
instructionVectorBoolTakeN :: State -> State
|
instructionVectorBoolTakeN :: State -> State
|
||||||
instructionVectorBoolTakeN = instructionTakeN vectorBool
|
instructionVectorBoolTakeN = instructionVectorTakeN vectorBool
|
||||||
|
|
||||||
instructionVectorBoolSubVector :: State -> State
|
instructionVectorBoolSubVector :: State -> State
|
||||||
instructionVectorBoolSubVector = instructionSubVector vectorBool
|
instructionVectorBoolSubVector = instructionSubVector vectorBool
|
||||||
@ -25,10 +25,10 @@ instructionVectorBoolNth :: State -> State
|
|||||||
instructionVectorBoolNth = instructionVectorNth bool vectorBool
|
instructionVectorBoolNth = instructionVectorNth bool vectorBool
|
||||||
|
|
||||||
instructionVectorBoolRest :: State -> State
|
instructionVectorBoolRest :: State -> State
|
||||||
instructionVectorBoolRest = instructionRest vectorBool
|
instructionVectorBoolRest = instructionVectorRest vectorBool
|
||||||
|
|
||||||
instructionVectorBoolButLast :: State -> State
|
instructionVectorBoolButLast :: State -> State
|
||||||
instructionVectorBoolButLast = instructionButLast vectorBool
|
instructionVectorBoolButLast = instructionVectorButLast vectorBool
|
||||||
|
|
||||||
instructionVectorBoolLength :: State -> State
|
instructionVectorBoolLength :: State -> State
|
||||||
instructionVectorBoolLength = instructionLength vectorBool
|
instructionVectorBoolLength = instructionLength vectorBool
|
||||||
@ -61,7 +61,7 @@ instructionVectorBoolReplaceFirst :: State -> State
|
|||||||
instructionVectorBoolReplaceFirst = instructionVectorReplace bool vectorBool (Just 1)
|
instructionVectorBoolReplaceFirst = instructionVectorReplace bool vectorBool (Just 1)
|
||||||
|
|
||||||
instructionVectorBoolRemove :: State -> State
|
instructionVectorBoolRemove :: State -> State
|
||||||
instructionVectorBoolRemove = instructionVectorRemove bool vectorBool
|
instructionVectorBoolRemove = instructionVectorRemove bool vectorBool Nothing
|
||||||
|
|
||||||
instructionVectorBoolIterate :: State -> State
|
instructionVectorBoolIterate :: State -> State
|
||||||
instructionVectorBoolIterate = instructionVectorIterate bool vectorBool GeneVectorBool instructionVectorBoolIterate "instructionVectorBoolIterate"
|
instructionVectorBoolIterate = instructionVectorIterate bool vectorBool GeneVectorBool instructionVectorBoolIterate "instructionVectorBoolIterate"
|
||||||
|
@ -4,13 +4,13 @@ import HushGP.State
|
|||||||
import HushGP.Instructions.GenericInstructions
|
import HushGP.Instructions.GenericInstructions
|
||||||
|
|
||||||
instructionVectorCharConcat :: State -> State
|
instructionVectorCharConcat :: State -> State
|
||||||
instructionVectorCharConcat = instructionConcat vectorChar
|
instructionVectorCharConcat = instructionVectorConcat vectorChar
|
||||||
|
|
||||||
instructionVectorCharConj :: State -> State
|
instructionVectorCharConj :: State -> State
|
||||||
instructionVectorCharConj = instructionConj char vectorChar
|
instructionVectorCharConj = instructionVectorConj char vectorChar
|
||||||
|
|
||||||
instructionVectorCharTakeN :: State -> State
|
instructionVectorCharTakeN :: State -> State
|
||||||
instructionVectorCharTakeN = instructionTakeN vectorChar
|
instructionVectorCharTakeN = instructionVectorTakeN vectorChar
|
||||||
|
|
||||||
instructionVectorCharSubVector :: State -> State
|
instructionVectorCharSubVector :: State -> State
|
||||||
instructionVectorCharSubVector = instructionSubVector vectorChar
|
instructionVectorCharSubVector = instructionSubVector vectorChar
|
||||||
@ -25,10 +25,10 @@ instructionVectorCharNth :: State -> State
|
|||||||
instructionVectorCharNth = instructionVectorNth char vectorChar
|
instructionVectorCharNth = instructionVectorNth char vectorChar
|
||||||
|
|
||||||
instructionVectorCharRest :: State -> State
|
instructionVectorCharRest :: State -> State
|
||||||
instructionVectorCharRest = instructionRest vectorChar
|
instructionVectorCharRest = instructionVectorRest vectorChar
|
||||||
|
|
||||||
instructionVectorCharButLast :: State -> State
|
instructionVectorCharButLast :: State -> State
|
||||||
instructionVectorCharButLast = instructionButLast vectorChar
|
instructionVectorCharButLast = instructionVectorButLast vectorChar
|
||||||
|
|
||||||
instructionVectorCharLength :: State -> State
|
instructionVectorCharLength :: State -> State
|
||||||
instructionVectorCharLength = instructionLength vectorChar
|
instructionVectorCharLength = instructionLength vectorChar
|
||||||
@ -61,7 +61,7 @@ instructionVectorCharReplaceFirst :: State -> State
|
|||||||
instructionVectorCharReplaceFirst = instructionVectorReplace char vectorChar (Just 1)
|
instructionVectorCharReplaceFirst = instructionVectorReplace char vectorChar (Just 1)
|
||||||
|
|
||||||
instructionVectorCharRemove :: State -> State
|
instructionVectorCharRemove :: State -> State
|
||||||
instructionVectorCharRemove = instructionVectorRemove char vectorChar
|
instructionVectorCharRemove = instructionVectorRemove char vectorChar Nothing
|
||||||
|
|
||||||
instructionVectorCharIterate :: State -> State
|
instructionVectorCharIterate :: State -> State
|
||||||
instructionVectorCharIterate = instructionVectorIterate char vectorChar GeneVectorChar instructionVectorCharIterate "instructionVectorCharIterate"
|
instructionVectorCharIterate = instructionVectorIterate char vectorChar GeneVectorChar instructionVectorCharIterate "instructionVectorCharIterate"
|
||||||
|
@ -4,13 +4,13 @@ import HushGP.State
|
|||||||
import HushGP.Instructions.GenericInstructions
|
import HushGP.Instructions.GenericInstructions
|
||||||
|
|
||||||
instructionVectorFloatConcat :: State -> State
|
instructionVectorFloatConcat :: State -> State
|
||||||
instructionVectorFloatConcat = instructionConcat vectorFloat
|
instructionVectorFloatConcat = instructionVectorConcat vectorFloat
|
||||||
|
|
||||||
instructionVectorFloatConj :: State -> State
|
instructionVectorFloatConj :: State -> State
|
||||||
instructionVectorFloatConj = instructionConj float vectorFloat
|
instructionVectorFloatConj = instructionVectorConj float vectorFloat
|
||||||
|
|
||||||
instructionVectorFloatTakeN :: State -> State
|
instructionVectorFloatTakeN :: State -> State
|
||||||
instructionVectorFloatTakeN = instructionTakeN vectorFloat
|
instructionVectorFloatTakeN = instructionVectorTakeN vectorFloat
|
||||||
|
|
||||||
instructionVectorFloatSubVector :: State -> State
|
instructionVectorFloatSubVector :: State -> State
|
||||||
instructionVectorFloatSubVector = instructionSubVector vectorFloat
|
instructionVectorFloatSubVector = instructionSubVector vectorFloat
|
||||||
@ -25,10 +25,10 @@ instructionVectorFloatNth :: State -> State
|
|||||||
instructionVectorFloatNth = instructionVectorNth float vectorFloat
|
instructionVectorFloatNth = instructionVectorNth float vectorFloat
|
||||||
|
|
||||||
instructionVectorFloatRest :: State -> State
|
instructionVectorFloatRest :: State -> State
|
||||||
instructionVectorFloatRest = instructionRest vectorFloat
|
instructionVectorFloatRest = instructionVectorRest vectorFloat
|
||||||
|
|
||||||
instructionVectorFloatButLast :: State -> State
|
instructionVectorFloatButLast :: State -> State
|
||||||
instructionVectorFloatButLast = instructionButLast vectorFloat
|
instructionVectorFloatButLast = instructionVectorButLast vectorFloat
|
||||||
|
|
||||||
instructionVectorFloatLength :: State -> State
|
instructionVectorFloatLength :: State -> State
|
||||||
instructionVectorFloatLength = instructionLength vectorFloat
|
instructionVectorFloatLength = instructionLength vectorFloat
|
||||||
@ -61,7 +61,7 @@ instructionVectorFloatReplaceFirst :: State -> State
|
|||||||
instructionVectorFloatReplaceFirst = instructionVectorReplace float vectorFloat (Just 1)
|
instructionVectorFloatReplaceFirst = instructionVectorReplace float vectorFloat (Just 1)
|
||||||
|
|
||||||
instructionVectorFloatRemove :: State -> State
|
instructionVectorFloatRemove :: State -> State
|
||||||
instructionVectorFloatRemove = instructionVectorRemove float vectorFloat
|
instructionVectorFloatRemove = instructionVectorRemove float vectorFloat Nothing
|
||||||
|
|
||||||
instructionVectorFloatIterate :: State -> State
|
instructionVectorFloatIterate :: State -> State
|
||||||
instructionVectorFloatIterate = instructionVectorIterate float vectorFloat GeneVectorFloat instructionVectorFloatIterate "instructionVectorFloatIterate"
|
instructionVectorFloatIterate = instructionVectorIterate float vectorFloat GeneVectorFloat instructionVectorFloatIterate "instructionVectorFloatIterate"
|
||||||
|
@ -4,13 +4,13 @@ import HushGP.Instructions.GenericInstructions
|
|||||||
import HushGP.State
|
import HushGP.State
|
||||||
|
|
||||||
instructionVectorIntConcat :: State -> State
|
instructionVectorIntConcat :: State -> State
|
||||||
instructionVectorIntConcat = instructionConcat vectorInt
|
instructionVectorIntConcat = instructionVectorConcat vectorInt
|
||||||
|
|
||||||
instructionVectorIntConj :: State -> State
|
instructionVectorIntConj :: State -> State
|
||||||
instructionVectorIntConj = instructionConj int vectorInt
|
instructionVectorIntConj = instructionVectorConj int vectorInt
|
||||||
|
|
||||||
instructionVectorIntTakeN :: State -> State
|
instructionVectorIntTakeN :: State -> State
|
||||||
instructionVectorIntTakeN = instructionTakeN vectorInt
|
instructionVectorIntTakeN = instructionVectorTakeN vectorInt
|
||||||
|
|
||||||
instructionVectorIntSubVector :: State -> State
|
instructionVectorIntSubVector :: State -> State
|
||||||
instructionVectorIntSubVector = instructionSubVector vectorInt
|
instructionVectorIntSubVector = instructionSubVector vectorInt
|
||||||
@ -25,10 +25,10 @@ instructionVectorIntNth :: State -> State
|
|||||||
instructionVectorIntNth = instructionVectorNth int vectorInt
|
instructionVectorIntNth = instructionVectorNth int vectorInt
|
||||||
|
|
||||||
instructionVectorIntRest :: State -> State
|
instructionVectorIntRest :: State -> State
|
||||||
instructionVectorIntRest = instructionRest vectorInt
|
instructionVectorIntRest = instructionVectorRest vectorInt
|
||||||
|
|
||||||
instructionVectorIntButLast :: State -> State
|
instructionVectorIntButLast :: State -> State
|
||||||
instructionVectorIntButLast = instructionButLast vectorInt
|
instructionVectorIntButLast = instructionVectorButLast vectorInt
|
||||||
|
|
||||||
instructionVectorIntLength :: State -> State
|
instructionVectorIntLength :: State -> State
|
||||||
instructionVectorIntLength = instructionLength vectorInt
|
instructionVectorIntLength = instructionLength vectorInt
|
||||||
@ -61,7 +61,7 @@ instructionVectorIntReplaceFirst :: State -> State
|
|||||||
instructionVectorIntReplaceFirst = instructionVectorReplace int vectorInt (Just 1)
|
instructionVectorIntReplaceFirst = instructionVectorReplace int vectorInt (Just 1)
|
||||||
|
|
||||||
instructionVectorIntRemove :: State -> State
|
instructionVectorIntRemove :: State -> State
|
||||||
instructionVectorIntRemove = instructionVectorRemove int vectorInt
|
instructionVectorIntRemove = instructionVectorRemove int vectorInt Nothing
|
||||||
|
|
||||||
instructionVectorIntIterate :: State -> State
|
instructionVectorIntIterate :: State -> State
|
||||||
instructionVectorIntIterate = instructionVectorIterate int vectorInt GeneVectorInt instructionVectorIntIterate "instructionVectorIntIterate"
|
instructionVectorIntIterate = instructionVectorIterate int vectorInt GeneVectorInt instructionVectorIntIterate "instructionVectorIntIterate"
|
||||||
|
@ -4,13 +4,13 @@ import HushGP.State
|
|||||||
import HushGP.Instructions.GenericInstructions
|
import HushGP.Instructions.GenericInstructions
|
||||||
|
|
||||||
instructionVectorStringConcat :: State -> State
|
instructionVectorStringConcat :: State -> State
|
||||||
instructionVectorStringConcat = instructionConcat vectorString
|
instructionVectorStringConcat = instructionVectorConcat vectorString
|
||||||
|
|
||||||
instructionVectorStringConj :: State -> State
|
instructionVectorStringConj :: State -> State
|
||||||
instructionVectorStringConj = instructionConj string vectorString
|
instructionVectorStringConj = instructionVectorConj string vectorString
|
||||||
|
|
||||||
instructionVectorStringTakeN :: State -> State
|
instructionVectorStringTakeN :: State -> State
|
||||||
instructionVectorStringTakeN = instructionTakeN vectorString
|
instructionVectorStringTakeN = instructionVectorTakeN vectorString
|
||||||
|
|
||||||
instructionVectorStringSubVector :: State -> State
|
instructionVectorStringSubVector :: State -> State
|
||||||
instructionVectorStringSubVector = instructionSubVector vectorString
|
instructionVectorStringSubVector = instructionSubVector vectorString
|
||||||
@ -25,10 +25,10 @@ instructionVectorStringNth :: State -> State
|
|||||||
instructionVectorStringNth = instructionVectorNth string vectorString
|
instructionVectorStringNth = instructionVectorNth string vectorString
|
||||||
|
|
||||||
instructionVectorStringRest :: State -> State
|
instructionVectorStringRest :: State -> State
|
||||||
instructionVectorStringRest = instructionRest vectorString
|
instructionVectorStringRest = instructionVectorRest vectorString
|
||||||
|
|
||||||
instructionVectorStringButLast :: State -> State
|
instructionVectorStringButLast :: State -> State
|
||||||
instructionVectorStringButLast = instructionButLast vectorString
|
instructionVectorStringButLast = instructionVectorButLast vectorString
|
||||||
|
|
||||||
instructionVectorStringLength :: State -> State
|
instructionVectorStringLength :: State -> State
|
||||||
instructionVectorStringLength = instructionLength vectorString
|
instructionVectorStringLength = instructionLength vectorString
|
||||||
@ -61,7 +61,7 @@ instructionVectorStringReplaceFirst :: State -> State
|
|||||||
instructionVectorStringReplaceFirst = instructionVectorReplace string vectorString (Just 1)
|
instructionVectorStringReplaceFirst = instructionVectorReplace string vectorString (Just 1)
|
||||||
|
|
||||||
instructionVectorStringRemove :: State -> State
|
instructionVectorStringRemove :: State -> State
|
||||||
instructionVectorStringRemove = instructionVectorRemove string vectorString
|
instructionVectorStringRemove = instructionVectorRemove string vectorString Nothing
|
||||||
|
|
||||||
instructionVectorStringIterate :: State -> State
|
instructionVectorStringIterate :: State -> State
|
||||||
instructionVectorStringIterate = instructionVectorIterate string vectorString GeneVectorString instructionVectorStringIterate "instructionVectorStringIterate"
|
instructionVectorStringIterate = instructionVectorIterate string vectorString GeneVectorString instructionVectorStringIterate "instructionVectorStringIterate"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user