I have a object form this typedef.
type ListDA = (State, [((State, Char), State)], [State])
For a Function, i need the second argument and i don't now how i get this.
I have a object form this typedef.
type ListDA = (State, [((State, Char), State)], [State])
For a Function, i need the second argument and i don't now how i get this.
You could write a helper function:
snd3 :: (a, b, c) -> b
snd3 (_, b, _) = b
Or you could do the pattern matching directly in your function parameters, e.g. by replacing
yourFunction object = ...
with
yourFunction object @ (_, secondArgument, _) = ...
You may be better off defining a separate type:
data ListDA = ListDA {firstField :: State,
secondField :: [((State, Char), State)],
thirdField :: [State]}
This method defines accessor functions for you.