G-d willing
Hello,
Considering I have the following data structures:
data TypeSingle = TypeSingle with
valueInt : Int
data TypeList = TypeList with
typeSingle : [TypeSingle]
data TypeExample = TypeExample with
typeList : TypeList
I am trying to set the valueInt
field of the first instance of typeSingle
list when creating an instance of TypeExample
.
I am familiar with the head
function, however, I am trying to get a way of doing it in one command.
This is how the function should be:
funcExample : TypeExample -> Int -> TypeExample
funcExample sourceExample someValue =
sourceExample with
-- typeList[0].valueInt = someValue
Thanks