Skip to content

Commit

Permalink
Add Data instance to NonEmptyText
Browse files Browse the repository at this point in the history
  • Loading branch information
glasserc committed Mar 1, 2024
1 parent 598048d commit 784e61d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Data/StringVariants/NonEmptyText/Internal.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
Expand All @@ -14,6 +15,7 @@ import Control.Monad (when)
import Data.Aeson (FromJSON (..), ToJSON, withText)
import Data.ByteString
import Data.Coerce
import Data.Data (Data)
import Data.MonoTraversable
import Data.Proxy
import Data.Sequences
Expand All @@ -30,7 +32,7 @@ import Prelude

-- | Non Empty Text, requires the input is between 1 and @n@ chars and not just whitespace.
newtype NonEmptyText (n :: Nat) = NonEmptyText Text
deriving stock (Generic, Show, Read, Lift)
deriving stock (Data, Generic, Show, Read, Lift)
deriving newtype (Eq, Ord, ToJSON, MonoFoldable)

type instance Element (NonEmptyText _n) = Char
Expand Down

0 comments on commit 784e61d

Please sign in to comment.