{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}

module Language.Lsd.AST.SimpleRegex
    ( Star (..)
    , Disjunction (..)
    , Sequence (..)
    )
where

import Data.Aeson (FromJSON, ToJSON)
import Data.OpenApi (ToSchema)
import GHC.Generics (Generic)

newtype Star a = Star a
    deriving ((forall a b. (a -> b) -> Star a -> Star b)
-> (forall a b. a -> Star b -> Star a) -> Functor Star
forall a b. a -> Star b -> Star a
forall a b. (a -> b) -> Star a -> Star b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Star a -> Star b
fmap :: forall a b. (a -> b) -> Star a -> Star b
$c<$ :: forall a b. a -> Star b -> Star a
<$ :: forall a b. a -> Star b -> Star a
Functor)

newtype Disjunction a = Disjunction [a]
    deriving ((forall a b. (a -> b) -> Disjunction a -> Disjunction b)
-> (forall a b. a -> Disjunction b -> Disjunction a)
-> Functor Disjunction
forall a b. a -> Disjunction b -> Disjunction a
forall a b. (a -> b) -> Disjunction a -> Disjunction b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Disjunction a -> Disjunction b
fmap :: forall a b. (a -> b) -> Disjunction a -> Disjunction b
$c<$ :: forall a b. a -> Disjunction b -> Disjunction a
<$ :: forall a b. a -> Disjunction b -> Disjunction a
Functor, Functor Disjunction
Functor Disjunction =>
(forall a. a -> Disjunction a)
-> (forall a b.
    Disjunction (a -> b) -> Disjunction a -> Disjunction b)
-> (forall a b c.
    (a -> b -> c) -> Disjunction a -> Disjunction b -> Disjunction c)
-> (forall a b. Disjunction a -> Disjunction b -> Disjunction b)
-> (forall a b. Disjunction a -> Disjunction b -> Disjunction a)
-> Applicative Disjunction
forall a. a -> Disjunction a
forall a b. Disjunction a -> Disjunction b -> Disjunction a
forall a b. Disjunction a -> Disjunction b -> Disjunction b
forall a b. Disjunction (a -> b) -> Disjunction a -> Disjunction b
forall a b c.
(a -> b -> c) -> Disjunction a -> Disjunction b -> Disjunction c
forall (f :: * -> *).
Functor f =>
(forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
$cpure :: forall a. a -> Disjunction a
pure :: forall a. a -> Disjunction a
$c<*> :: forall a b. Disjunction (a -> b) -> Disjunction a -> Disjunction b
<*> :: forall a b. Disjunction (a -> b) -> Disjunction a -> Disjunction b
$cliftA2 :: forall a b c.
(a -> b -> c) -> Disjunction a -> Disjunction b -> Disjunction c
liftA2 :: forall a b c.
(a -> b -> c) -> Disjunction a -> Disjunction b -> Disjunction c
$c*> :: forall a b. Disjunction a -> Disjunction b -> Disjunction b
*> :: forall a b. Disjunction a -> Disjunction b -> Disjunction b
$c<* :: forall a b. Disjunction a -> Disjunction b -> Disjunction a
<* :: forall a b. Disjunction a -> Disjunction b -> Disjunction a
Applicative, Int -> Disjunction a -> ShowS
[Disjunction a] -> ShowS
Disjunction a -> String
(Int -> Disjunction a -> ShowS)
-> (Disjunction a -> String)
-> ([Disjunction a] -> ShowS)
-> Show (Disjunction a)
forall a. Show a => Int -> Disjunction a -> ShowS
forall a. Show a => [Disjunction a] -> ShowS
forall a. Show a => Disjunction a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Disjunction a -> ShowS
showsPrec :: Int -> Disjunction a -> ShowS
$cshow :: forall a. Show a => Disjunction a -> String
show :: Disjunction a -> String
$cshowList :: forall a. Show a => [Disjunction a] -> ShowS
showList :: [Disjunction a] -> ShowS
Show, (forall x. Disjunction a -> Rep (Disjunction a) x)
-> (forall x. Rep (Disjunction a) x -> Disjunction a)
-> Generic (Disjunction a)
forall x. Rep (Disjunction a) x -> Disjunction a
forall x. Disjunction a -> Rep (Disjunction a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Disjunction a) x -> Disjunction a
forall a x. Disjunction a -> Rep (Disjunction a) x
$cfrom :: forall a x. Disjunction a -> Rep (Disjunction a) x
from :: forall x. Disjunction a -> Rep (Disjunction a) x
$cto :: forall a x. Rep (Disjunction a) x -> Disjunction a
to :: forall x. Rep (Disjunction a) x -> Disjunction a
Generic)

instance (ToJSON a) => ToJSON (Disjunction a)

instance (FromJSON a) => FromJSON (Disjunction a)

instance (ToSchema a) => ToSchema (Disjunction a)

newtype Sequence a = Sequence [a]
    deriving ((forall a b. (a -> b) -> Sequence a -> Sequence b)
-> (forall a b. a -> Sequence b -> Sequence a) -> Functor Sequence
forall a b. a -> Sequence b -> Sequence a
forall a b. (a -> b) -> Sequence a -> Sequence b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Sequence a -> Sequence b
fmap :: forall a b. (a -> b) -> Sequence a -> Sequence b
$c<$ :: forall a b. a -> Sequence b -> Sequence a
<$ :: forall a b. a -> Sequence b -> Sequence a
Functor)