+
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Rel8.hs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module Rel8

-- ** @MaybeTable@
, MaybeTable
, maybeTable, ($?), nothingTable, justTable
, maybeTable, ($?), projectMaybe, nothingTable, justTable
, isNothingTable, isJustTable
, fromMaybeTable
, optional
Expand Down
12 changes: 12 additions & 0 deletions src/Rel8/Table/Maybe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module Rel8.Table.Maybe
, isNothingTable, isJustTable
, fromMaybeTable
, ($?)
, projectMaybe
, nameMaybeTable
, makeMaybeTable
, unsafeFromJustTable
Expand Down Expand Up @@ -232,6 +233,17 @@ f $? ma@(MaybeTable _ a) = case nullable @b of
infixl 4 $?


-- | If a @'MaybeTable' 'Expr'@ contains a single column, it can be
-- projected into a @'Expr' Maybe@. This is a simple application of
-- @('$?')@, provided for readability.
--
-- @
-- projectMaybe = (id '$?')
-- @
projectMaybe :: DBType a => MaybeTable Expr (Expr a) -> Expr (Maybe a)
projectMaybe = (id $?)


-- | Construct a 'MaybeTable' in the 'Name' context. This can be useful if you
-- have a 'MaybeTable' that you are storing in a table and need to construct a
-- 'TableSchema'.
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载