Skip to content

Abstract communication with clients over some arbitrary monad#1

Open
jmorag wants to merge 5 commits into
mainfrom
capability
Open

Abstract communication with clients over some arbitrary monad#1
jmorag wants to merge 5 commits into
mainfrom
capability

Conversation

@jmorag

@jmorag jmorag commented Apr 23, 2021

Copy link
Copy Markdown
Collaborator

Should be useful for testing without having to spawn four local telnet instances.

Comment thread src/Euchre/Utils.hs
let players = computePlayerOrder st in
map (\player -> filterValidCards st $ st ^. nthPlayer player . hand) players
hands :: Lens' (EuchreState m) [Hand]
hands = partsOf' (players . hand)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hands lens doesn't behave exactly like the combination of viewHands and setHands used to, as viewHands filtered valid cards. However, we never actually called viewHands, and using it in a lens would be unlawful anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant