type Api = NamedRoutes RootApi data RootApi mode = RootApi { subApi :: mode :- NamedRoutes SubApi , … } deriving Generic data SubApi mode = SubApi { endpoint :: mode :- Get '[JSON] Person , … } deriving Generic api :: Proxy API api = Proxy rootClient :: RootApi (AsClientT ClientM) rootClient = client api endpointClient :: ClientM Person endpointClient = client // subApi // endpoint
<*> monoidalFieldAla "extensions" (alaList' FSep MQuoted) oldExtensions ^^^ deprecatedSince [1,12] "Please use 'default-extensions' or 'other-extensions' fields."
>>> map (apply 2) [succ, recip, negate] [3.0,0.5,-2.0]In general you should prefer using an explicit lambda or operator section.
>>> map (\ f -> 2 |> f) [succ, recip, negate] [3.0,0.5,-2.0] >>> map (2 |>) [succ, recip, negate] [3.0,0.5,-2.0] >>> map (<| 2) [succ, recip, negate] [3.0,0.5,-2.0]
\ x -> apply x f == f x
>>> 3 !> succ !> recip !> negate -0.25The difference between this and (|>) is that this evaluates its argument before passing it to the function.
>>> undefined |> const True True >>> undefined !> const True *** Exception: Prelude.undefined ...
\ x -> (x !> f) == seq x (f x)
\ x -> (x !> f !> g) == let y = seq x (f x) in seq y (g y)
>>> map (apply' 2) [succ, recip, negate] [3.0,0.5,-2.0]The different between this and apply is that this evaluates its argument before passing it to the function.
>>> apply undefined (const True) True >>> apply' undefined (const True) *** Exception: Prelude.undefined ...In general you should prefer using an explicit lambda or operator section.
>>> map (\ f -> 2 !> f) [succ, recip, negate] [3.0,0.5,-2.0] >>> map (2 !>) [succ, recip, negate] [3.0,0.5,-2.0] >>> map (<! 2) [succ, recip, negate] [3.0,0.5,-2.0]
\ x -> apply' x f == seq x (f x)
mkElement "div" # set style [("color","#CCAABB")] # set draggable True # set children otherElements
grd # addColorStop(0, "#8ED6FF");This can be seen as equivalent of grd.addColorStop(0, "#8ED6FF").
>>> 255 .@hex "0x0000_0000_0000_00ff" >>> 0xf1 .@bin "0b1111_0001" >>> 2^12 .@dec "4096" >>> 4 * giga .@pos1 [32]
0x0 .@color (bits 31 24) 0b0000_0000_0000_0000_0000_0000_0000_0000_1111_1111_0000_0000_0000_0000_0000_0000 ^^^^ ^^^^
onApp = (&)
p ? t ?? fNote that parentheses are required in order to chain sequences of conditionals together. This is probably a good thing.
f $ g $ h x = f (g (h x))It is also useful in higher-order situations, such as map ($ 0) xs, or zipWith ($) fs xs. Note that ($) is levity-polymorphic in its result type, so that foo $ True where foo :: Bool -> Int# is well-typed.
f $ g $ h x = f (g (h x))It is also useful in higher-order situations, such as map ($ 0) xs, or zipWith ($) fs xs. Note that ($) is representation-polymorphic in its result type, so that foo $ True where foo :: Bool -> Int# is well-typed.