module Exon.Data.Segment where
data Segment a =
String String
|
Whitespace String
|
Expression a
deriving stock (Segment a -> Segment a -> Bool
(Segment a -> Segment a -> Bool)
-> (Segment a -> Segment a -> Bool) -> Eq (Segment a)
forall a. Eq a => Segment a -> Segment a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Segment a -> Segment a -> Bool
$c/= :: forall a. Eq a => Segment a -> Segment a -> Bool
== :: Segment a -> Segment a -> Bool
$c== :: forall a. Eq a => Segment a -> Segment a -> Bool
Eq, Int -> Segment a -> ShowS
[Segment a] -> ShowS
Segment a -> String
(Int -> Segment a -> ShowS)
-> (Segment a -> String)
-> ([Segment a] -> ShowS)
-> Show (Segment a)
forall a. Show a => Int -> Segment a -> ShowS
forall a. Show a => [Segment a] -> ShowS
forall a. Show a => Segment a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Segment a] -> ShowS
$cshowList :: forall a. Show a => [Segment a] -> ShowS
show :: Segment a -> String
$cshow :: forall a. Show a => Segment a -> String
showsPrec :: Int -> Segment a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Segment a -> ShowS
Show, (forall a b. (a -> b) -> Segment a -> Segment b)
-> (forall a b. a -> Segment b -> Segment a) -> Functor Segment
forall a b. a -> Segment b -> Segment a
forall a b. (a -> b) -> Segment a -> Segment b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Segment b -> Segment a
$c<$ :: forall a b. a -> Segment b -> Segment a
fmap :: forall a b. (a -> b) -> Segment a -> Segment b
$cfmap :: forall a b. (a -> b) -> Segment a -> Segment b
Functor)
instance IsString (Segment a) where
fromString :: String -> Segment a
fromString =
String -> Segment a
forall a. String -> Segment a
String