Hoogle Search
Within LTS Haskell 24.15 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
runToEnd :: Recursive (->) t (Either a) => t -> ayaya Yaya.Applied This will collapse all the intermediate steps to get to the value that must exist at the end.
constantly :: Corecursive (->) t (Pair a) => a -> tyaya Yaya.Applied Creates an infinite stream of the provided value.
now :: Steppable (->) t (Either a) => a -> tyaya Yaya.Applied No documentation available.
reverse :: (Recursive (->) t (XNor a), Steppable (->) u (XNor a)) => t -> uyaya Yaya.Applied No documentation available.
return :: PolyCont (Return r') r Void => r' -> rcontrol-dsl Control.Dsl Lift r to the answer type, similar to return. This return function aims to be used as the last statement of a do block. When return is present in a nested do block for when or unless, if the r' is not (), it will create a Cont that performs early return, skipping the rest statements of the outer do notation.
Examples
>>> :set -XTypeOperators >>> :set -XRebindableSyntax >>> import Prelude hiding ((>>), (>>=), return, fail) >>> import Control.Dsl >>> import Control.Dsl.Return >>> import Control.Dsl.Yield >>> import Control.Dsl.Cont >>> import Control.Dsl.Empty
>>> :{ earlyGenerator :: Bool -> Cont [String] Integer earlyGenerator earlyReturn = do Yield "inside earlyGenerator" when earlyReturn $ do Yield "early return" return 1 Yield "normal return" return 0 :}
>>> :{ earlyGeneratorTest :: [String] earlyGeneratorTest = do Yield "before earlyGenerator" i <- earlyGenerator True Yield "after earlyGenerator" Yield $ "the return value of earlyGenerator is " ++ show i empty :}
>>> earlyGeneratorTest ["before earlyGenerator","inside earlyGenerator","early return","after earlyGenerator","the return value of earlyGenerator is 1"]
return :: PolyCont (Return r') r Void => r' -> rcontrol-dsl Control.Dsl.Return Lift r to the answer type, similar to return. This return function aims to be used as the last statement of a do block. When return is present in a nested do block for when or unless, if the r' is not (), it will create a Cont that performs early return, skipping the rest statements of the outer do notation.
Examples
>>> :set -XTypeOperators >>> :set -XRebindableSyntax >>> import Prelude hiding ((>>), (>>=), return, fail) >>> import Control.Dsl >>> import Control.Dsl.Return >>> import Control.Dsl.Yield >>> import Control.Dsl.Cont >>> import Control.Dsl.Empty
>>> :{ earlyGenerator :: Bool -> Cont [String] Integer earlyGenerator earlyReturn = do Yield "inside earlyGenerator" when earlyReturn $ do Yield "early return" return 1 Yield "normal return" return 0 :}
>>> :{ earlyGeneratorTest :: [String] earlyGeneratorTest = do Yield "before earlyGenerator" i <- earlyGenerator True Yield "after earlyGenerator" Yield $ "the return value of earlyGenerator is " ++ show i empty :}
>>> earlyGeneratorTest ["before earlyGenerator","inside earlyGenerator","early return","after earlyGenerator","the return value of earlyGenerator is 1"]
toFields :: Default ToFields haskells fields => haskells -> fieldsopaleye Opaleye.Internal.Constant No documentation available.
toFields :: Default ToFields haskells fields => haskells -> fieldsopaleye Opaleye.ToFields toFields provides a convenient typeclass wrapper around the Field_ creation functions in Opaleye.SqlTypes. Besides convenience it doesn't provide any additional functionality. It can be used with functions like runInsert to insert custom Haskell types into the database. The following is an example of a function for inserting custom types.
customInsert :: ( Default ToFields haskells fields ) => Connection -> Table fields fields' -> [haskells] -> IO Int64 customInsert conn table haskells = runInsert_ conn Insert { iTable = table , iRows = map toFields haskells , iReturning = rCount , iOnConflict = Nothing }
In order to use this function with your custom types, you need to define an instance of Default ToFields for your custom types.toFieldsI :: Default (Inferrable ToFields) haskells fields => haskells -> fieldsopaleye Opaleye.ToFields Version of toFields with better type inference
show :: (Show a, StringConv String b) => a -> bprotolude Protolude No documentation available.