halma/src/Game/Halma/Rules.hs

Summary

Maintainability
Test Coverage

Use lambda-case
Open

    A.withText "MoveRestriction" $ \text ->
      case text of
        "allowed"     -> pure Allowed
        "temporarily" -> pure Temporarily
        "forbidden"   -> pure Forbidden
Severity: Minor
Found in halma/src/Game/Halma/Rules.hs by hlint

Found

\ text ->
  case text of
      "allowed" -> pure Allowed
      "temporarily" -> pure Temporarily
      "forbidden" -> pure Forbidden
      _ -> fail "expected 'allowed', 'temporarily' or 'forbidden'"

Perhaps

\case
    "allowed" -> pure Allowed
    "temporarily" -> pure Temporarily
    "forbidden" -> pure Forbidden
    _ -> fail "expected 'allowed', 'temporarily' or 'forbidden'"

Applying this change:

  • may require {-# LANGUAGE LambdaCase #-} adding to the top of the file

There are no issues that match your filters.

Category
Status