Search results
intercept :: forall a e g f. ErrorControl f g e => f a -> (e -> a) -> g a
mapFlipped :: forall f a b. Functor f => f a -> (a -> b) -> f b
mapFlipped is map with its arguments reversed. For example:
[1, 2, 3] <#> \n -> n * n
cmapFlipped :: forall a b f. Contravariant f => f a -> (b -> a) -> f b
cmapFlipped is cmap with its arguments reversed.
flippedMap :: forall f a b. Functor f => f a -> (a -> b) -> f b
map :: forall c f v1 v0. HasMap c f => ObjectOf c v0 => ObjectOf c v1 => c v0 v1 -> f v0 -> f v1
fmodify :: forall m r s. MonadEffect m => Refer s r => r -> (s -> s) -> m s
freads :: forall m r s a. MonadEffect m => Refer s r => r -> (s -> a) -> m a
applyFirst :: forall a b f. Apply f => f a -> f b -> f a
Combine two effectful actions, keeping only the result of the first.
try :: forall e m a. MonadError e m => m a -> m (Either e a)
Return Right if the given action succeeds, Left if it throws.
sampleOnRight_ :: forall event a b. IsEvent event => event a -> event b -> event a
Create an Event which samples the latest values from the first event
at the times when the second event fires, ignoring the values produced by
the second event.
sampleOn_ :: forall b a event. IsEvent event => event a -> event b -> event a
Create an Event which samples the latest values from the first event
at the times when the second event fires, ignoring the values produced by
the second event.
applyFirst :: forall v1 v0 f c. HasApply c f => HasConst c => HasMap c f => ObjectOf c v0 => ObjectOf c v1 => ObjectOf c (c v1 v0) => f v0 -> f v1 -> f v0
bind :: forall a. Semigroup a => a -> (a -> a) -> a
trial :: forall a e g f. ErrorControl f g e => Monad f => f a -> g (Either e a)
applyFlipped :: forall a b. a -> (a -> b) -> b
Applies an argument to a function. This is primarily used as the (#)
operator, which allows parentheses to be omitted in some cases, or as a
natural way to apply a value to a chain of composed functions.
mulNat :: forall proxy a b c. ProductNat a b c => proxy a -> proxy b -> proxy c
plus :: forall proxy a b c. SumInt a b c => proxy a -> proxy b -> proxy c
plusNat :: forall proxy a b c. SumNat a b c => proxy a -> proxy b -> proxy c
powNat :: forall proxy a b c. ExponentiationNat a b c => proxy a -> proxy b -> proxy c
> powNat d2 d3
8 -- : NProxy D8
a raised to the power of b a^b = c
prod :: forall proxy a b c. ProductInt a b c => proxy a -> proxy b -> proxy c
concat :: forall xs ys zs lproxy. Concat xs ys zs => lproxy xs -> lproxy ys -> lproxy zs
drop :: forall n xs ys lproxy iproxy. Drop n xs ys => iproxy n -> lproxy xs -> lproxy ys
map :: forall f xs ys fproxy kproxy lproxy. Map f xs ys => fproxy f -> kproxy xs -> lproxy ys
take :: forall n xs ys lproxy iproxy. Take n xs ys => iproxy n -> lproxy xs -> lproxy ys
zip :: forall x y z lproxy. Zip x y z => lproxy x -> lproxy y -> lproxy z
getOrAlt :: forall v s r' r l h g f. Alternative h => Cons s v r' r => RowToList r l => RGetOrAlt f g s l r => g s -> f r -> h v
_call :: forall b a. a -> (a -> b) -> b
extract :: forall r x a. TypeEquals r x => r -> (x -> a) -> a
nmapFlipped :: forall b a fb fa. NestedFunctor fa fb a b => fa -> (a -> b) -> fb
t :: forall b a. a -> (a -> b) -> b
Reverse application which is
probably exist inside Lens module
t :: forall b a. a -> (a -> b) -> b
thrush :: forall b a. a -> (a -> b) -> b
T combinator - thrush
CI
Λ a b . a → (a → b) → b
λ x f . f x
alt :: forall f a. Alt f => f a -> f a -> f a
choose :: forall m a. MonadGen m => m a -> m a -> m a
Creates a generator that outputs a value chosen from one of two existing existing generators with even probability.
max1 :: forall f a. Ord1 f => f a -> f a -> f a
min1 :: forall f a. Ord1 f => f a -> f a -> f a
onIntegrityError :: forall m a. MonadError PGError m => m a -> m a -> m a
alt :: forall f a. Alternative f => f a -> f a -> f a
dappend :: forall cnt a. Diff cnt => cnt a -> cnt a -> cnt a
fromFoldableL :: forall a c f. Foldable f => Consable c => c a -> f a -> c a
Conversion from Foldable to Consable using foldl.
fromFoldableL [] [1,2,3,4] == [4,3,2,1]
fromFoldableL [0] [1,2,3,4] == [4,3,2,1,0]
fromFoldableR :: forall a c f. Foldable f => Consable c => c a -> f a -> c a
Conversion from Foldable to Consable using foldr.
fromFoldableR [] [1,2,3,4] == [1,2,3,4]
fromFoldableR [5] [1,2,3,4] == [1,2,3,4,5]
interleave :: forall m a. MonadLogic m => m a -> m a -> m a
applySecond :: forall a b f. Apply f => f a -> f b -> f b
Combine two effectful actions, keeping only the result of the second.
sampleOnLeft_ :: forall event a b. IsEvent event => event a -> event b -> event b
applySecond :: forall v1 v0 f c. HasApply c f => HasConst c => HasIdentity c => HasMap c f => ObjectOf c v0 => ObjectOf c v1 => ObjectOf c (c v1 v1) => ObjectOf c (c v0 (c v1 v1)) => ObjectOf c (c (c v1 v1) (c v0 (c v1 v1))) => f v0 -> f v1 -> f v1
voidRight :: forall f a b. Functor f => a -> f b -> f a
Ignore the return value of a computation, using the specified return value instead.
bipure :: forall w a b. Biapplicative w => a -> b -> w a b
liftEither :: forall m e a. MonadThrow e m => Either e a -> m a
Lift an Either value to a MonadThrow monad.
unsafeFromRight :: forall a b. Either a b -> b
slacken :: forall v1 v0 c. ObjectOf c v0 => ObjectOf c v1 => Slackable c => c v0 v1 -> v0 -> v1
flipScalarMul :: forall k f. VectorField f k => f k -> k -> f k
get :: forall v s r' r l g f. Cons s v r' r => RGet f g s l r => RowToList r l => g s -> f r -> v
match :: forall v r1 r0 l1 l0 g f. RMatch f g v l0 r0 l1 r1 => RowToList r0 l0 => RowToList r1 l1 => f r0 -> g r1 -> v
asLeft :: forall f a e. Alternative f => Either e a -> f e
asRight :: forall f a e. Alternative f => Either e a -> f a
fromLeft :: forall b a. Partial => Either a b -> a
Extract an error result.
fromRight :: forall b a. Partial => Either a b -> b
Extract a valid result.
functorDecorate :: forall b a f. Functor f => Decorate a b => a -> f b -> f a
snoc :: forall f a. Container f => f a -> a -> f a
voidLeft :: forall f a b. Functor f => f a -> b -> f b
A version of voidRight with its arguments flipped.
rsingleton :: forall f g s v r. RSingleton f g s => Cons s v () r => Lacks s () => g s -> v -> f r
singleton :: forall v s r g f. Cons s v () r => Lacks s () => RSingleton f g s => g s -> v -> f r
functorDecorateFlipped :: forall b a f. Functor f => Decorate b a => f a -> b -> f b
seek :: forall s a w. ComonadStore s w => s -> w a -> w a
Reposition the focus at the specified position.
filled :: forall m a style. MonadCanvasAction m => CanvasStyle style => style -> m a -> m a
Run a MonadCanvasAction with the given fillStyle, resetting it to the
previous value after
putCtx :: forall a html ctx. Ctx ctx html => ctx -> html a -> html a
stroked :: forall m a style. MonadCanvasAction m => CanvasStyle style => style -> m a -> m a
Run a MonadCanvasAction with the given strokeStyle, resetting it to the
previous value after
tellAccum :: forall acc html a. TellAccum acc html => acc -> html a -> html a
scalarMul :: forall f k. VectorField f k => k -> f k -> f k
- ∀v in V: one * v == v
- ∀a b in K, v in V: a * (b .* v) = (a * b) .* v
- ∀a b in K, v in V:
- a .* (u + v) = a .* u + a .* v
- (a + b) .* v = a .* v + b .* v
cons :: forall t a. Consable t => a -> t a -> t a
cons :: forall f a. Container f => a -> f a -> f a
insert :: forall f a. Container f => Ord a => a -> f a -> f a
option :: forall a m. Alternative m => a -> m a -> m a
replaceInArray :: forall a f. HasUuid a => Functor f => a -> f a -> f a
duplicate :: forall a w. Extend w => w a -> w (w a)
Duplicate a comonadic context.
duplicate is dual to Control.Bind.join.
intercalate :: forall f m. Foldable f => Monoid m => m -> f m -> m
Fold a data structure, accumulating values in some Monoid,
combining adjacent elements using the specified separator.
For example:
> intercalate ", " ["Lorem", "ipsum", "dolor"]
= "Lorem, ipsum, dolor"
> intercalate "*" ["a", "b", "c"]
= "a*b*c"
> intercalate [1] [[2, 3], [4, 5], [6, 7]]
= [2, 3, 1, 4, 5, 1, 6, 7]
intercalate :: forall f m. Foldable1 f => Semigroup m => m -> f m -> m
Fold a data structure using a Semigroup instance,
combining adjacent elements using the specified separator.
surround :: forall f m. Foldable f => Semigroup m => m -> f m -> m
fold but with each element surrounded by some fixed value.
For example:
> surround "*" []
= "*"
> surround "*" ["1"]
= "*1*"
> surround "*" ["1", "2"]
= "*1*2*"
> surround "*" ["1", "2", "3"]
= "*1*2*3*"
unfoldable :: forall m f a. MonadRec m => MonadGen m => Unfoldable f => m a -> m (f a)
Creates a generator that produces unfoldable structures based on an existing generator for the elements.
The size of the unfoldable will be determined by the current size state
for the generator. To generate an unfoldable structure of a particular
size, use the resize function from the MonadGen class first.
enumFromTo :: forall a u. Enum a => Unfoldable1 u => a -> a -> u a
Returns a contiguous sequence of elements from the first value to the second value (inclusive).
enumFromTo 0 3 = [0, 1, 2, 3]
enumFromTo 'c' 'a' = ['c', 'b', 'a']
The example shows Array return values, but the result can be any type
with an Unfoldable1 instance.
lower :: forall f w a. ComonadTrans f => Comonad w => f w a -> w a
peek :: forall s w a. ComonadStore s w => s -> w a -> a
track :: forall t w a. ComonadTraced t w => t -> w a -> a
unwrapCofree :: forall f w a. ComonadCofree f w => w a -> f (w a)
fork :: forall f m a. MonadFork f m => m a -> m (f a)
suspend :: forall f m a. MonadFork f m => m a -> m (f a)
buildLeaf :: forall e f p v. ElementBuilder e f p v => e -> f p -> v
toBase :: forall b m a. MonadUnlift b m => m a -> m (b a)
Run the given action inside the base monad b.
unpoint :: forall c u v. HasUnpoint c u => ObjectOf c u => ObjectOf c v => c u v -> v
consMax :: forall a f. Foldable f => Ord a => a -> f a -> a
consMin :: forall a f. Foldable f => Ord a => a -> f a -> a
convertOption :: forall field from to sproxy. ConvertOption field from to => sproxy field -> from -> to
index :: forall f a b. Representable f a => f b -> (a -> b)
invokeAction :: forall m res args ctrl act. RemoteAction act ctrl args res => MonadReader Visualforce m => MonadAff m => MonadError RemoteActionError m => IsSymbol ctrl => Encode args => Decode res => act -> args -> m res
Function that invoke the action defined by referring to contraints which holds details about the correct controller to invoke. Example:
data PCMRequests = ..
data CreatePCMRequests = CreatePCMRequests
instance remoteActionCreatePCMs :: RemoteAction CreatePCMRequests "PCMMassController.createRecords" PCMRequests Unit
createPCMRequest :: Visualforce -> PCMRequests -> Aff (Either RemoteActionError Unit)
createPCMRequest vf rec = runReaderT (runExceptT $ invokeAction CreatePCMRequests rec) vf
split :: forall f a. Applicative f => f a -> f (f a)
bifold :: forall t m. Bifoldable t => Monoid m => t m m -> m
Fold a data structure, accumulating values in a monoidal type.
askRunInBase :: forall b m a. MonadUnlift b m => m (m a -> b a)
A monomorphic version of askUnlift which can be more convenient when you only want to use the resulting runner function once with a concrete type.
If you run into type issues using this, try using askUnlit instead.
askRunBase :: forall a stM m base. MonadBaseUnlift base m stM => Applicative base => m (m a -> base a)
add :: forall a. Semiring a => a -> a -> a
append :: forall a. Semigroup a => a -> a -> a
conj :: forall a. HeytingAlgebra a => a -> a -> a
const :: forall a b. a -> b -> a
Returns its first argument and ignores its second.
const 1 "hello" = 1
It can also be thought of as creating a function that ignores its argument:
const 1 = \_ -> 1
disj :: forall a. HeytingAlgebra a => a -> a -> a
div :: forall a. EuclideanRing a => a -> a -> a
gcd :: forall a. Eq a => EuclideanRing a => a -> a -> a
The greatest common divisor of two values.
genericAdd :: forall a rep. Generic a rep => GenericSemiring rep => a -> a -> a
A Generic implementation of the add member from the Semiring type class.
genericAdd' :: forall a. GenericSemiring a => a -> a -> a
genericAppend :: forall a rep. Generic a rep => GenericSemigroup rep => a -> a -> a
A Generic implementation of the append member from the Semigroup type class.
genericAppend' :: forall a. GenericSemigroup a => a -> a -> a
genericConj :: forall a rep. Generic a rep => GenericHeytingAlgebra rep => a -> a -> a
A Generic implementation of the conj member from the HeytingAlgebra type class.
genericConj' :: forall a. GenericHeytingAlgebra a => a -> a -> a
genericDisj :: forall a rep. Generic a rep => GenericHeytingAlgebra rep => a -> a -> a
A Generic implementation of the disj member from the HeytingAlgebra type class.
genericDisj' :: forall a. GenericHeytingAlgebra a => a -> a -> a
genericImplies :: forall a rep. Generic a rep => GenericHeytingAlgebra rep => a -> a -> a
A Generic implementation of the implies member from the HeytingAlgebra type class.
genericImplies' :: forall a. GenericHeytingAlgebra a => a -> a -> a
genericMul :: forall a rep. Generic a rep => GenericSemiring rep => a -> a -> a
A Generic implementation of the mul member from the Semiring type class.
genericMul' :: forall a. GenericSemiring a => a -> a -> a
genericSub :: forall a rep. Generic a rep => GenericRing rep => a -> a -> a
A Generic implementation of the sub member from the Ring type class.
genericSub' :: forall a. GenericRing a => a -> a -> a
implies :: forall a. HeytingAlgebra a => a -> a -> a
lcm :: forall a. Eq a => EuclideanRing a => a -> a -> a
The least common multiple of two values.
leftDiv :: forall a. DivisionRing a => a -> a -> a
Left division, defined as leftDiv a b = recip b * a. Left and right
division are distinct in this module because a DivisionRing is not
necessarily commutative.
If the type a is also a EuclideanRing, then this function is
equivalent to div from the EuclideanRing class. When working
abstractly, div should generally be preferred, unless you know that you
need your code to work with noncommutative rings.
max :: forall a. Ord a => a -> a -> a
Take the maximum of two values. If they are considered equal, the first argument is chosen.
min :: forall a. Ord a => a -> a -> a
Take the minimum of two values. If they are considered equal, the first argument is chosen.
mod :: forall a. EuclideanRing a => a -> a -> a
mul :: forall a. Semiring a => a -> a -> a
rightDiv :: forall a. DivisionRing a => a -> a -> a
Right division, defined as rightDiv a b = a * recip b. Left and right
division are distinct in this module because a DivisionRing is not
necessarily commutative.
If the type a is also a EuclideanRing, then this function is
equivalent to div from the EuclideanRing class. When working
abstractly, div should generally be preferred, unless you know that you
need your code to work with noncommutative rings.
sub :: forall a. Ring a => a -> a -> a
extract :: forall w a. Comonad w => w a -> a
and :: forall a f. Foldable f => HeytingAlgebra a => f a -> a
The conjunction of all the values in a data structure. When specialized
to Boolean, this function will test whether all of the values in a data
structure are true.
fold :: forall f m. Foldable f => Monoid m => f m -> m
Fold a data structure, accumulating values in some Monoid.
fold1 :: forall t m. Foldable1 t => Semigroup m => t m -> m
Fold a data structure, accumulating values in some Semigroup.
length :: forall a b f. Foldable f => Semiring b => f a -> b
Returns the size/length of a finite structure. Optimized for structures that are similar to cons-lists, because there is no general way to do better.
maximum :: forall f a. Ord a => Foldable1 f => f a -> a
minimum :: forall f a. Ord a => Foldable1 f => f a -> a
or :: forall a f. Foldable f => HeytingAlgebra a => f a -> a
The disjunction of all the values in a data structure. When specialized
to Boolean, this function will test whether any of the values in a data
structure is true.
product :: forall a f. Foldable f => Semiring a => f a -> a
Find the product of the numeric values in a data structure.
sum :: forall a f. Foldable f => Semiring a => f a -> a
Find the sum of the numeric values in a data structure.
forever :: forall m a b. MonadRec m => m a -> m b
forever runs an action indefinitely, using the MonadRec instance to
ensure constant stack usage.
For example:
main = forever $ trace "Hello, World!"
proof :: forall a b p. TypeEquals a b => p a -> p b
elements :: forall m f a. MonadGen m => Foldable1 f => f a -> m a
Creates a generator that outputs a value chosen from a selection with uniform probability.
coerce :: forall f a b. Contravariant f => Functor f => f a -> f b
ask :: forall e w a. ComonadAsk e w => w a -> e
pos :: forall s w a. ComonadStore s w => w a -> s
inj :: forall f g a. Inject f g => f a -> g a
sans :: forall m a b. At m a b => a -> m -> m
join :: forall f m a. MonadFork f m => f a -> m a
uninterruptible :: forall e f m a. MonadBracket e f m => m a -> m a
add :: forall x y z. Add x y z => x -> y -> z
and :: forall b1 b2 b3. And b1 b2 b3 => b1 -> b2 -> b3