Hedgehog: returning a list from `commandExecute` and getting to the items in an update function

Hello, I'm trying to use Hedgehog to test a web app at work. Yesterday I ran into an issue with getting to the value returned from my `commandExecute` in an `Update` `Callback`. Basically my model looks like this ~~~ newtype State (v :: * -> *) = State (M.Map (Var UUID v) DataPerItem) deriving (Eq, Show) ~~~ and I have an action, `Command gen exec [Update update]` where ~~~ exec :: action -> m [UUID] ~~~ which results in ~~~ update :: State v -> action -> Var [UUID] v -> State v ~~~ AFAICS I need to, in order to actually update my model, turn that `Var [UUID] v` into `[Var UUID v]`. I've been staring at the functions in Hedgehog for a while now but nothing jumps out... or am I, once again, thinking about it all wrong? :) /M I also asked at stackoverflow: https://stackoverflow.com/questions/58157292/returning-a-list-and-getting-to... This is just to widen the net a bit... -- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus@therning.org twitter: magthe http://magnus.therning.org/ Ah, good taste! What a dreadful thing! Taste is the enemy of creativeness. — Pablo Picasso

I found an open issue for what I've run into (I think):
https://github.com/hedgehogqa/haskell-hedgehog/issues/113
/M
Magnus Therning
Hello,
I'm trying to use Hedgehog to test a web app at work. Yesterday I ran into an issue with getting to the value returned from my `commandExecute` in an `Update` `Callback`.
Basically my model looks like this
~~~ newtype State (v :: * -> *) = State (M.Map (Var UUID v) DataPerItem) deriving (Eq, Show) ~~~
and I have an action, `Command gen exec [Update update]` where
~~~ exec :: action -> m [UUID] ~~~
which results in
~~~ update :: State v -> action -> Var [UUID] v -> State v ~~~
AFAICS I need to, in order to actually update my model, turn that `Var [UUID] v` into `[Var UUID v]`. I've been staring at the functions in Hedgehog for a while now but nothing jumps out... or am I, once again, thinking about it all wrong? :)
/M
I also asked at stackoverflow: https://stackoverflow.com/questions/58157292/returning-a-list-and-getting-to... This is just to widen the net a bit...
-- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus@therning.org twitter: magthe http://magnus.therning.org/ Action is the foundational key to all success. — Pablo Picasso

Magnus Therning
I found an open issue for what I've run into (I think): https://github.com/hedgehogqa/haskell-hedgehog/issues/113
My copy-pasting skills need work! The issue is this: https://github.com/hedgehogqa/haskell-hedgehog/issues/126 /M
Magnus Therning
writes: Hello,
I'm trying to use Hedgehog to test a web app at work. Yesterday I ran into an issue with getting to the value returned from my `commandExecute` in an `Update` `Callback`.
Basically my model looks like this
~~~ newtype State (v :: * -> *) = State (M.Map (Var UUID v) DataPerItem) deriving (Eq, Show) ~~~
and I have an action, `Command gen exec [Update update]` where
~~~ exec :: action -> m [UUID] ~~~
which results in
~~~ update :: State v -> action -> Var [UUID] v -> State v ~~~
AFAICS I need to, in order to actually update my model, turn that `Var [UUID] v` into `[Var UUID v]`. I've been staring at the functions in Hedgehog for a while now but nothing jumps out... or am I, once again, thinking about it all wrong? :)
/M
I also asked at stackoverflow: https://stackoverflow.com/questions/58157292/returning-a-list-and-getting-to... This is just to widen the net a bit...
-- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus@therning.org twitter: magthe http://magnus.therning.org/ Every act of creation is first an act of destruction. — Pablo Picasso
participants (1)
-
Magnus Therning