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
)
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 qualified Data.List as List
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, 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)

-- Alias for haskell newcomers :)
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 :: 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 :: a -> Text
show = a -> Text
forall a. Show a => a -> Text
tshow

error :: Text -> a
error :: 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 :: [a] -> Maybe a
head [] = Maybe a
forall a. Maybe a
Nothing
head [a]
list = a -> Maybe a
forall a. a -> Maybe a
Just ([a] -> a
forall a. [a] -> a
List.head [a]
list)

headMay :: [a] -> Maybe a
headMay :: [a] -> Maybe a
headMay = [a] -> Maybe a
forall a. [a] -> Maybe a
head

last :: [a] -> Maybe a
last :: [a] -> Maybe a
last [] = Maybe a
forall a. Maybe a
Nothing
last [a]
list = a -> Maybe a
forall a. a -> Maybe a
Just ([a] -> a
forall a. [a] -> a
List.last [a]
list)

lastMay :: [a] -> Maybe a
lastMay :: [a] -> Maybe a
lastMay = [a] -> Maybe a
forall a. [a] -> Maybe a
last

tail :: [a] -> Maybe [a]
tail :: [a] -> Maybe [a]
tail [] = Maybe [a]
forall a. Maybe a
Nothing
tail [a]
list = [a] -> Maybe [a]
forall a. a -> Maybe a
Just ([a] -> [a]
forall a. [a] -> [a]
List.tail [a]
list)

tailMay :: [a] -> Maybe [a]
tailMay :: [a] -> Maybe [a]
tailMay = [a] -> Maybe [a]
forall a. [a] -> Maybe [a]
tail

init :: [a] -> Maybe [a]
init :: [a] -> Maybe [a]
init [] = Maybe [a]
forall a. Maybe a
Nothing
init [a]
list = [a] -> Maybe [a]
forall a. a -> Maybe a
Just ([a] -> [a]
forall a. [a] -> [a]
List.init [a]
list)

initMay :: [a] -> Maybe [a]
initMay :: [a] -> Maybe [a]
initMay = [a] -> Maybe [a]
forall a. [a] -> Maybe [a]
init

plain :: QuasiQuoter
plain = QuasiQuoter
Data.String.Interpolate.i