packages feed

telega-0.2.4: Network/API/Telegram/Bot/Object/Update/Message/Content/File/Caption.hs

module Network.API.Telegram.Bot.Object.Update.Message.Content.File.Caption (Caption (..)) where

import "aeson" Data.Aeson (FromJSON (parseJSON), ToJSON (toJSON), Value (String), withText)
import "base" Control.Applicative (pure)
import "base" Data.Function ((.))
import "base" Text.Show (Show)
import "text" Data.Text (Text)

newtype Caption = Caption Text
	deriving Show

instance FromJSON Caption where
	parseJSON = withText "Caption" (pure . Caption)

instance ToJSON Caption where
	toJSON (Caption txt) = String txt