2 Module : Gargantext.API.Admin.Utils
3 Description : Server API main Types
4 Copyright : (c) CNRS, 2017-Present
6 Maintainer : team@gargantext.org
7 Stability : experimental
10 Mainly copied from Servant.Job.Utils (Thanks)
15 module Gargantext.API.Admin.Utils
18 import Gargantext.Prelude
19 import Data.Maybe (Maybe, fromMaybe)
20 import Prelude (String)
21 import qualified Data.Text as T
25 -- Reverse infix form of "fromMaybe"
26 (?|) :: Maybe a -> a -> a
31 -- Reverse infix form of "fromJust" with a custom error message
32 (?!) :: Maybe a -> String -> a
33 (?!) ma' msg = ma' ?| panic (T.pack msg)