[Haskell-cafe] Hedgehog: returning a list from `commandExecute` and getting to the items in an update function

Magnus Therning magnus at therning.org
Mon Sep 30 20:06:02 UTC 2019


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-the-items-in-hedgehog-state-machine
This is just to widen the net a bit...

--
Magnus Therning              OpenPGP: 0x927912051716CE39
email: magnus at therning.org
twitter: magthe              http://magnus.therning.org/

Ah, good taste! What a dreadful thing! Taste is the enemy of
creativeness.
     — Pablo Picasso
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20190930/94badd7e/attachment.sig>


More information about the Haskell-Cafe mailing list