cplug-0.2.0.0: Recompile and run partially applied C functions in Haskell, during runtime
Aux
Synopsis
tupToList :: (a, a) -> [a] Source
Converts a tuple to a list
lastTup :: [a] -> Maybe ([a], a) Source
Illustrative example:
>>> lastTup [1,2,3,4] ([1,2,3], 4)
>>>
lastTup [1,2,3,4]
Used to parse input vars, ex:
lastTup ["unsigned", "int", "x"] == Just (["unsigned", "int"], "x")
apFst :: (a1 -> a2) -> (a1, a) -> (a2, a) Source
Applies a function to the first element of a tuple.
apToLast :: (a -> a) -> [a] -> [a] Source
Apply the input function to the last element of the list
>>> apToLast (const 0) [1,2,3,4] [1,2,3,0]
apToLast (const 0) [1,2,3,4]