module Composite.Opaleye.Util where
import Data.Profunctor (dimap)
import Opaleye (Field, ToFields, unsafeCoerceColumn)
constantColumnUsing :: ToFields haskell (Field sqlType)
-> (haskell' -> haskell)
-> ToFields haskell' (Field sqlType')
constantColumnUsing :: ToFields haskell (Field sqlType)
-> (haskell' -> haskell) -> ToFields haskell' (Field sqlType')
constantColumnUsing ToFields haskell (Field sqlType)
oldToFields haskell' -> haskell
f = (haskell' -> haskell)
-> (Field sqlType -> Field sqlType')
-> ToFields haskell (Field sqlType)
-> ToFields haskell' (Field sqlType')
forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
dimap haskell' -> haskell
f Field sqlType -> Field sqlType'
forall (n :: Nullability) a (n' :: Nullability) b.
Field_ n a -> Field_ n' b
unsafeCoerceColumn ToFields haskell (Field sqlType)
oldToFields