module IHP.Prelude
( module CorePrelude
, module Data.Text.IO
, module IHP.HaskellSupport
, module GHC.Records
, UUID
, module Data.Default
, tshow
, Proxy (..)
, module Control.Monad
, module Data.List
, head
, headMay
, last
, lastMay
, tail
, tailMay
, init
, initMay
, show
, module Data.String.Conversions
, module Data.Time.Clock
, module Data.Time.Calendar
, module Data.Time.LocalTime
, module Data.Text
, module GHC.OverloadedLabels
, plain
, (++)
, error
, module Data.Data
, module GHC.TypeLits
, module IHP.NameSupport
, module IHP.ModelSupport
, module Data.TMap
, module Database.PostgreSQL.Simple
, module Data.IORef
, module Data.Time.Format
, null
, module Control.Exception
, module Control.Monad.Fail
, module Control.Concurrent.Async
, module NeatInterpolation
, module GHC.Stack
, module Data.Kind
)
where
import CorePrelude hiding (putStr, putStrLn, print, error)
import Data.Text.IO (putStr, putStrLn)
import IHP.HaskellSupport
import Data.Default (def, Default (..))
import ClassyPrelude (null)
import Data.UUID (UUID)
import GHC.Records
import qualified Prelude
import qualified Data.Text as Text
import Data.Proxy (Proxy (Proxy))
import Control.Monad (when, unless, mapM, mapM_, forM, forM_, sequence, sequence_, join, forever)
import Data.List hiding (head, last, unwords, unlines, words, lines, isPrefixOf, isSuffixOf, isInfixOf, intercalate, intersperse, (++), splitAt, null, tail, init)
import Data.String.Conversions (ConvertibleStrings (convertString), cs)
import Data.Time.Clock
import Data.Time.Calendar
import Data.Time.LocalTime
import Data.Text (words, unwords, lines, unlines, intersperse, intercalate, toLower, toUpper, isInfixOf, isSuffixOf, isPrefixOf, splitAt)
import qualified Data.String.Interpolate
import GHC.OverloadedLabels
import Data.Data (Data)
import GHC.TypeLits (KnownSymbol, Symbol, symbolVal)
import IHP.NameSupport
import IHP.ModelSupport (ModelContext (..), CanUpdate, NormalizeModel, Id, GetTableName, GetModelName, updateRecord, updateRecordDiscardResult, createRecord, deleteRecord, MetaBag (..))
import Data.TMap (TMap)
import Database.PostgreSQL.Simple (FromRow)
import Data.IORef
import Data.Time.Format
import Control.Exception (throw, throwIO, catch)
import Control.Monad.Fail (fail)
import Control.Concurrent.Async
import NeatInterpolation (trimming)
import GHC.Stack (HasCallStack, CallStack)
import Data.Kind (Type)
a
a ++ :: a -> a -> a
++ a
b = a
a a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
b
tshow :: Show a => a -> Text
tshow :: forall a. Show a => a -> Text
tshow a
value = String -> Text
Text.pack (a -> String
forall a. Show a => a -> String
Prelude.show a
value)
show :: Show a => a -> Text
show :: forall a. Show a => a -> Text
show = a -> Text
forall a. Show a => a -> Text
tshow
error :: Text -> a
error :: forall a. Text -> a
error Text
message = String -> a
forall a. HasCallStack => String -> a
Prelude.error (Text -> String
Text.unpack Text
message)
head :: [a] -> Maybe a
head :: forall a. [a] -> Maybe a
head [] = Maybe a
forall a. Maybe a
Nothing
head (a
firstItem:[a]
rest) = a -> Maybe a
forall a. a -> Maybe a
Just a
firstItem
headMay :: [a] -> Maybe a
headMay :: forall a. [a] -> Maybe a
headMay = [a] -> Maybe a
forall a. [a] -> Maybe a
head
last :: [a] -> Maybe a
last :: forall a. [a] -> Maybe a
last [] = Maybe a
forall a. Maybe a
Nothing
last [a
item] = a -> Maybe a
forall a. a -> Maybe a
Just a
item
last (a
_:[a]
rest) = [a] -> Maybe a
forall a. [a] -> Maybe a
last [a]
rest
lastMay :: [a] -> Maybe a
lastMay :: forall a. [a] -> Maybe a
lastMay = [a] -> Maybe a
forall a. [a] -> Maybe a
last
tail :: [a] -> Maybe [a]
tail :: forall a. [a] -> Maybe [a]
tail (a
_:[a]
rest) = [a] -> Maybe [a]
forall a. a -> Maybe a
Just [a]
rest
tail [] = Maybe [a]
forall a. Maybe a
Nothing
tailMay :: [a] -> Maybe [a]
tailMay :: forall a. [a] -> Maybe [a]
tailMay = [a] -> Maybe [a]
forall a. [a] -> Maybe [a]
tail
init :: [a] -> Maybe [a]
init :: forall a. [a] -> Maybe [a]
init [a]
list = ([a], a) -> [a]
forall a b. (a, b) -> a
fst (([a], a) -> [a]) -> Maybe ([a], a) -> Maybe [a]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([a] -> Maybe ([a], a)
forall a. [a] -> Maybe ([a], a)
unsnoc [a]
list)
initMay :: [a] -> Maybe [a]
initMay :: forall a. [a] -> Maybe [a]
initMay = [a] -> Maybe [a]
forall a. [a] -> Maybe [a]
init
plain :: QuasiQuoter
plain = QuasiQuoter
Data.String.Interpolate.i