Skip to content

Commit 2aae2af

Browse files
author
Patrick Thomson
committed
Add an NFData instance for Source.
1 parent 54394d6 commit 2aae2af

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

semantic-source/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.0.0.2
2+
3+
- Adds an `NFData` instance for `Source`.
4+
15
# 0.0.0.1
26

37
- Loosens the upper bound on `hashable`.

semantic-source/src/Source/Source.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ module Source.Source
3232
import Prelude hiding (drop, take)
3333

3434
import Control.Arrow ((&&&))
35+
import Control.DeepSeq (NFData)
3536
import Data.Aeson (FromJSON (..), withText)
3637
import qualified Data.ByteString as B
3738
import Data.Char (ord)
@@ -50,7 +51,7 @@ import Source.Span (Span(Span), Pos(..))
5051
-- 'ByteString' under the hood. Construct these with 'fromUTF8'; obviously,
5152
-- passing 'fromUTF8' non-UTF8 bytes will cause crashes.
5253
newtype Source = Source { bytes :: B.ByteString }
53-
deriving (Eq, Semigroup, Monoid, IsString, Show, Generic)
54+
deriving (Eq, Semigroup, Monoid, IsString, Show, Generic, NFData)
5455

5556
fromUTF8 :: B.ByteString -> Source
5657
fromUTF8 = Source

0 commit comments

Comments
 (0)