halma/src/Game/Halma/Board.hs
Use lambda-case Open
Open
A.withText "HalmaDirection" $ \text ->
case text of
"N" -> pure North
"NE" -> pure Northeast
"SE" -> pure Southeast
- Read upRead up
- Exclude checks
Found
\ text ->
case text of
"N" -> pure North
"NE" -> pure Northeast
"SE" -> pure Southeast
"S" -> pure South
"SW" -> pure Southwest
"NW" -> pure Northwest
_ -> fail
"expected a Halma direction (one of N, NE, SE, S, SW, NW)"
Perhaps
\case
"N" -> pure North
"NE" -> pure Northeast
"SE" -> pure Southeast
"S" -> pure South
"SW" -> pure Southwest
"NW" -> pure Northwest
_ -> fail
"expected a Halma direction (one of N, NE, SE, S, SW, NW)"