1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 18:23:44 +03:00

LambdaCase.

This commit is contained in:
Rob Rix 2019-10-17 21:59:35 -04:00
parent 7ab0695766
commit fbfcdd8985
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
2 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
{-# LANGUAGE AllowAmbiguousTypes, RankNTypes, ScopedTypeVariables, TypeFamilies, TypeOperators, UndecidableInstances #-} {-# LANGUAGE AllowAmbiguousTypes, LambdaCase, RankNTypes, ScopedTypeVariables, TypeFamilies, TypeOperators, UndecidableInstances #-}
module Analysis.TOCSummary module Analysis.TOCSummary
( Declaration(..) ( Declaration(..)
, formatIdentifier , formatIdentifier
@ -49,7 +49,7 @@ data Kind
deriving (Eq, Ord, Show) deriving (Eq, Ord, Show)
formatKind :: Kind -> T.Text formatKind :: Kind -> T.Text
formatKind kind = case kind of formatKind = \case
Function -> "Function" Function -> "Function"
Method _ -> "Method" Method _ -> "Method"
Heading l -> "Heading " <> T.pack (show l) Heading l -> "Heading " <> T.pack (show l)

View File

@ -1,4 +1,4 @@
{-# LANGUAGE DerivingVia, DuplicateRecordFields, RankNTypes, ScopedTypeVariables, TupleSections #-} {-# LANGUAGE DerivingVia, DuplicateRecordFields, LambdaCase, RankNTypes, ScopedTypeVariables, TupleSections #-}
module Rendering.TOC module Rendering.TOC
( diffTOC ( diffTOC
, Summaries(..) , Summaries(..)
@ -60,7 +60,7 @@ data Change
deriving (Eq, Show) deriving (Eq, Show)
instance ToJSON Change where instance ToJSON Change where
toJSON change = case change of toJSON = \case
Changed -> "modified" Changed -> "modified"
Deleted -> "removed" Deleted -> "removed"
Inserted -> "added" Inserted -> "added"