-- Copyright (c) 2016-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.


{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoRebindableSyntax #-}
{-# LANGUAGE TypeFamilies #-}

module Duckling.Regex.Types
  ( GroupMatch(..)
  ) where

import Control.DeepSeq
import Data.Hashable
import Data.Text (Text)
import GHC.Generics
import Prelude
import Duckling.Resolve (Resolve(..))

newtype GroupMatch = GroupMatch [Text]
  deriving (GroupMatch -> GroupMatch -> Bool
(GroupMatch -> GroupMatch -> Bool)
-> (GroupMatch -> GroupMatch -> Bool) -> Eq GroupMatch
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GroupMatch -> GroupMatch -> Bool
$c/= :: GroupMatch -> GroupMatch -> Bool
== :: GroupMatch -> GroupMatch -> Bool
$c== :: GroupMatch -> GroupMatch -> Bool
Eq, (forall x. GroupMatch -> Rep GroupMatch x)
-> (forall x. Rep GroupMatch x -> GroupMatch) -> Generic GroupMatch
forall x. Rep GroupMatch x -> GroupMatch
forall x. GroupMatch -> Rep GroupMatch x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GroupMatch x -> GroupMatch
$cfrom :: forall x. GroupMatch -> Rep GroupMatch x
Generic, Int -> GroupMatch -> Int
GroupMatch -> Int
(Int -> GroupMatch -> Int)
-> (GroupMatch -> Int) -> Hashable GroupMatch
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: GroupMatch -> Int
$chash :: GroupMatch -> Int
hashWithSalt :: Int -> GroupMatch -> Int
$chashWithSalt :: Int -> GroupMatch -> Int
Hashable, Eq GroupMatch
Eq GroupMatch
-> (GroupMatch -> GroupMatch -> Ordering)
-> (GroupMatch -> GroupMatch -> Bool)
-> (GroupMatch -> GroupMatch -> Bool)
-> (GroupMatch -> GroupMatch -> Bool)
-> (GroupMatch -> GroupMatch -> Bool)
-> (GroupMatch -> GroupMatch -> GroupMatch)
-> (GroupMatch -> GroupMatch -> GroupMatch)
-> Ord GroupMatch
GroupMatch -> GroupMatch -> Bool
GroupMatch -> GroupMatch -> Ordering
GroupMatch -> GroupMatch -> GroupMatch
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: GroupMatch -> GroupMatch -> GroupMatch
$cmin :: GroupMatch -> GroupMatch -> GroupMatch
max :: GroupMatch -> GroupMatch -> GroupMatch
$cmax :: GroupMatch -> GroupMatch -> GroupMatch
>= :: GroupMatch -> GroupMatch -> Bool
$c>= :: GroupMatch -> GroupMatch -> Bool
> :: GroupMatch -> GroupMatch -> Bool
$c> :: GroupMatch -> GroupMatch -> Bool
<= :: GroupMatch -> GroupMatch -> Bool
$c<= :: GroupMatch -> GroupMatch -> Bool
< :: GroupMatch -> GroupMatch -> Bool
$c< :: GroupMatch -> GroupMatch -> Bool
compare :: GroupMatch -> GroupMatch -> Ordering
$ccompare :: GroupMatch -> GroupMatch -> Ordering
$cp1Ord :: Eq GroupMatch
Ord, Int -> GroupMatch -> ShowS
[GroupMatch] -> ShowS
GroupMatch -> String
(Int -> GroupMatch -> ShowS)
-> (GroupMatch -> String)
-> ([GroupMatch] -> ShowS)
-> Show GroupMatch
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GroupMatch] -> ShowS
$cshowList :: [GroupMatch] -> ShowS
show :: GroupMatch -> String
$cshow :: GroupMatch -> String
showsPrec :: Int -> GroupMatch -> ShowS
$cshowsPrec :: Int -> GroupMatch -> ShowS
Show, GroupMatch -> ()
(GroupMatch -> ()) -> NFData GroupMatch
forall a. (a -> ()) -> NFData a
rnf :: GroupMatch -> ()
$crnf :: GroupMatch -> ()
NFData)

instance Resolve GroupMatch where
  type ResolvedValue GroupMatch = ()
  resolve :: Context
-> Options -> GroupMatch -> Maybe (ResolvedValue GroupMatch, Bool)
resolve Context
_ Options
_ GroupMatch
_ = Maybe (ResolvedValue GroupMatch, Bool)
forall a. Maybe a
Nothing