Search results

sequence :: forall t a m. Traversable t => Applicative m => t (m a) -> m (t a)
sequence1 :: forall t b f. Traversable1 t => Apply f => t (f b) -> f (t b)
sequence1Default :: forall t a m. Traversable1 t => Apply m => t (m a) -> m (t a)

A default implementation of sequence1 using traverse1.

sequenceDefault :: forall t a m. Traversable t => Applicative m => t (m a) -> m (t a)

A default implementation of sequence using traverse.

distribute :: forall f a g. Distributive f => Functor g => g (f a) -> f (g a)
distributeDefault :: forall a f g. Distributive f => Functor g => g (f a) -> f (g a)

A default implementation of distribute, based on collect.

parSequence :: forall a t m f. Parallel f m => Applicative f => Traversable t => t (m a) -> m (t a)
sequence :: forall m p q a. Dissect p q => MonadRec m => p (m a) -> m (p a)

A tail-recursive sequence operation, implemented in terms of Dissect.

sequence :: forall c b a. HasApply b => HasMap b => HasTraverse a => HasPure b => a (b c) -> b (a c)

Sequences actions and collects the results.

sequence [Just 1, Just 2] -- Just [1, 2]
inParallel :: forall f m a. Parallel f m => Applicative f => Array (m a) -> m (Array a)

Run multiple computations in parallel, and collect all results To only take the fastest result, use race

useHooks :: forall m a. MonadHooks m => Signal (m a) -> m (Signal a)

Unwrap a Signal

dynamic :: forall m a. MonadReplace m => MonadFRP m => Dynamic (m a) -> m (Dynamic a)
useHooks :: forall m a. MonadHooks m => Signal (m a) -> m (Signal a)

Unwrap a Signal

weakDynamic :: forall m a. MonadReplace m => MonadFRP m => WeakDynamic (m a) -> m (WeakDynamic a)
all :: forall a g f. Deferred => Foldable f => Unfoldable g => f (Promise a) -> Promise (g a)

Run all promises in the given Foldable, returning a new promise which either resolves to a collection of all the given promises' results, or rejects with the first promise to reject.

pivotAxes :: forall f a. Applicative f => Monoid (f a) => Foldable f => f (Vector3 a) -> { x :: f a, y :: f a, z :: f a }
all :: forall a. Array (LazyPromise a) -> LazyPromise (Array a)
unwrap :: forall a. Signal (Effect a) -> Effect (Signal a)

Takes a signal of effects of a, and produces an effect which returns a signal which will take each effect produced by the input signal, run it, and yield its returned value.

countQueuingStrategy :: forall a. { highWaterMark :: Int } -> Effect (QueuingStrategy a)
new :: forall chunk. { highWaterMark :: Int, size :: chunk -> Int } -> Effect (QueuingStrategy chunk)
all :: forall a. Array (LazyPromise a) -> LazyPromise (Array a)
useEffect :: forall m a. MonadHooks m => Signal (Effect a) -> m (Signal a)

Unwrap effective Signal

all :: forall a. NotJSPromise a => Array (PromiseSpec a) -> PromiseSpec (Array a)

Process all promise specs in an array

zip :: forall a. Array (Observable a) -> Observable (Array a)

Waits for each ObservableImpl to emit a value. Once this occurs, all values with the corresponding index will be emitted. This will continue until at least one inner ObservableImpl completes. marble diagram

all :: forall v. Array (Promise v) -> Promise (Array v)

Documentation: Promise.all()

allSettled :: forall v. Array (Promise v) -> Promise (Array v)

Documentation: Promise.allSettled()

any :: forall v. Array (Promise v) -> Promise (Array v)

Documentation: Promise.any()

combineLatestAll :: forall a. List (Observable a) -> Observable (List a)
cons :: forall a. Ord a => { head :: a, tail :: List a } -> Maybe (List a)
mkAdapter :: forall nodeRow. { nodesRef :: Ref (Array (MinimalNode nodeRow)), reheatFn :: Effect Unit, reinitForcesFn :: Effect Unit } -> EngineAdapter (MinimalNode nodeRow)

Create an EngineAdapter from D3 kernel components.

This bridges the generic core engine with D3-specific functionality. The adapter provides position capture/update and rule application.

performEvent :: forall m a. MonadFRP m => Event (Aff a) -> m (Event a)

Run asynchronous action when an Event occurs. The returned Event will fire when such an action completes.

Note: the results may arrive in a different order than the requests.

pivotNonEmptyAxes :: forall a. NonEmptyArray (Vector3 a) -> { x :: NonEmptyArray a, y :: NonEmptyArray a, z :: NonEmptyArray a }
runRule :: forall m. MonadEffect m => MonadThrow Error m => { assertViolationMessage :: String -> m Unit, module :: String, rule :: Rule } -> m (Array String)
runRule' :: forall m. MonadEffect m => MonadThrow Error m => { module :: String, rule :: Rule } -> m (Violations ())
runWhine :: forall m. MonadEffect m => { configFile :: FilePath, env :: Env, factories :: RuleFactories, globs :: Maybe (NonEmptyArray NonEmptyString) } -> m (Violations (WithRule + WithMuted + WithFile + ()))

The main entry point into the linter. It takes some basic parameters and runs the whole thing: reads the config, parses it, instantiates the rules, globs the input files, parses them, and runs the rules through every file.

sequenceShrinkList :: forall a. List (Tree a) -> Tree (List a)

Turn a list of trees in to a tree of lists, opting to shrink both the list itself and the elements in the list during traversal.

sequenceShrinkOne :: forall a. List (Tree a) -> Tree (List a)

Turn a list of trees in to a tree of lists, opting to shrink only the elements of the list (i.e. the size of the list will always be the same).

useEffect :: forall m a. MonadHooks m => Signal (Effect a) -> m (Signal a)

Unwrap effective Signal

zip :: forall a. Array (Observable a) -> Observable (Array a)

Waits for each ObservableImpl to emit a value. Once this occurs, all values with the corresponding index will be emitted. This will continue until at least one inner ObservableImpl completes. marble diagram

zip :: forall a. Array (AsyncSubject a) -> AsyncSubject (Array a)

Waits for each AsyncSubject to emit a value. Once this occurs, all values with the corresponding index will be emitted. This will continue until at least one inner AsyncSubject completes.

zip :: forall a. Array (BehaviorSubject a) -> BehaviorSubject (Array a)

Waits for each BehaviorSubject to emit a value. Once this occurs, all values with the corresponding index will be emitted. This will continue until at least one inner BehaviorSubject completes.

zip :: forall a. Array (Observable a) -> Observable (Array a)

Waits for each Observable to emit a value. Once this occurs, all values with the corresponding index will be emitted. This will continue until at least one inner observable completes. marble diagram

zip :: forall a. Array (ReplaySubject a) -> ReplaySubject (Array a)

Waits for each ReplaySubject to emit a value. Once this occurs, all values with the corresponding index will be emitted. This will continue until at least one inner ReplaySubject completes.

byteLengthQueuingStrategy :: { highWaterMark :: Int } -> Effect (QueuingStrategy Uint8Array)
streaming :: { cancel :: Effect Unit, pull :: Aff (Maybe StreamChunk) } -> Effect (Streaming StreamChunk)
pinAtCurrent :: forall r. { fx :: Nullable Number, fy :: Nullable Number, x :: Number, y :: Number | r } -> { fx :: Nullable Number, fy :: Nullable Number, x :: Number, y :: Number | r }

Pin a node at its current position.

Sets fx = x, fy = y so the node won't move during simulation.

Type signature uses row polymorphism - works with any node type that has the required fields.

unpin :: forall r. { fx :: Nullable Number, fy :: Nullable Number | r } -> { fx :: Nullable Number, fy :: Nullable Number | r }

Unpin a node (clear fx/fy).

Allows the node to move freely under force simulation.

layoutADT :: { constructors :: Array { args :: Array RenderType, name :: String }, keyword :: Maybe String, name :: String, typeParams :: Array String } -> { dimensions :: Dimensions, layout :: LayoutNode }

Lay out a data type with constructor branches.

layoutClassDef :: { methods :: Array { ast :: Maybe RenderType, name :: String }, name :: String, superclasses :: Array SuperclassInfo, typeParams :: Array String } -> { dimensions :: Dimensions, layout :: LayoutNode }

Lay out a type class definition.

layoutSignature :: { ast :: RenderType, className :: Maybe String, name :: String, sig :: String, typeParams :: Array String } -> { dimensions :: Dimensions, layout :: LayoutNode }

Lay out a value/type-synonym signature.

runFutureEffect :: forall a. Future (Effect a) -> Now (Future a)

Takes a future effect and returns a now-computation that runs the effect once the future occurs and delivers the result in a future.

runStreamEffect :: forall a. Stream (Effect a) -> Now (Stream a)

Takes a stream of effects and returns a now-computation that runs the effect in each occurrence and delivers the result in a stream.

static :: forall da a. Patch a da => Array (Jet a) -> Jet (IArray a)

Construct an array whose elements can change but whose length is fixed, from an array of jets.

allowNoneOrAll :: forall a f. Foldable f => Array (EqPred a) -> Constraint (f a)
allowNoneOrOne :: forall a g. Foldable g => Array (EqPred a) -> Constraint (g a)
border :: forall r. Array (BorderOption ()) -> EndStyleOption (border :: Array (BorderOption ()) | r)
border :: forall r. Array (BorderOption ()) -> ListStyleOption (border :: Array (BorderOption ()) | r)
border :: forall r. Array (BorderOption ()) -> StyleOption (border :: Array (BorderOption ()) | r)
eliminateNothings :: forall a. Tree (Maybe a) -> Array (Tree a)
focus :: forall r. Array (EndStyleOption ()) -> ListStyleOption (focus :: Array (EndStyleOption ()) | r)
focus :: forall r. Array (EndStyleOption ()) -> StyleOption (focus :: Array (EndStyleOption ()) | r)
hover :: forall r. Array (EndStyleOption ()) -> ListStyleOption (hover :: Array (EndStyleOption ()) | r)
hover :: forall r. Array (EndStyleOption ()) -> StyleOption (hover :: Array (EndStyleOption ()) | r)
item :: forall r. Array (EndStyleOption ()) -> ListStyleOption (item :: Array (EndStyleOption ()) | r)
scrollbar :: forall r. Array (BorderOption ()) -> EndStyleOption (scrollbar :: Array (BorderOption ()) | r)
scrollbar :: forall r. Array (BorderOption ()) -> ListStyleOption (scrollbar :: Array (BorderOption ()) | r)
scrollbar :: forall r. Array (BorderOption ()) -> StyleOption (scrollbar :: Array (BorderOption ()) | r)
selected :: forall r. Array (EndStyleOption ()) -> ListStyleOption (selected :: Array (EndStyleOption ()) | r)
shade :: { black :: Color, hue :: Color, white :: Color } -> { black :: Color, grey1 :: Color, grey2 :: Color, hue :: Color, hueDarker :: Color, hueDarkest :: Color, hueDisabled :: Color, white :: Color }
readRefMaybe :: forall a. Ref (Nullable a) -> Effect (Maybe a)
unfoldM' :: forall a f m. Monad m => Applicative f => Monoid (f a) => m (Maybe a) -> m (f a)

The supplied Maybe expression will be repeatedly called until it returns Nothing. All Just values are collected into an Applicative monoidal structure.

unfoldM' :: forall m f a. MonadRec m => Applicative f => Monoid (f a) => m (Maybe a) -> m (f a)

The supplied Maybe expression will be repeatedly called until it returns Nothing. All values returned are collected into an Applicative Monoid.

readNullableRefM :: forall r m. MonadDelay m => Ref (Nullable r) -> Effect (Maybe r)
transpose :: forall a. Array (Array a) -> Array (Array a)

The 'transpose' function transposes the rows and columns of its argument. For example,

transpose 
  [ [1, 2, 3]
  , [4, 5, 6]
  ] == 
  [ [1, 4]
  , [2, 5]
  , [3, 6]
  ]

If some of the rows are shorter than the following rows, their elements are skipped:

transpose 
  [ [10, 11]
  , [20]
  , [30, 31, 32]
  ] == 
  [ [10, 20, 30]
  , [11, 31]
  , [32]
  ]
transpose :: forall a. NonEmptyArray (NonEmptyArray a) -> NonEmptyArray (NonEmptyArray a)

The 'transpose' function transposes the rows and columns of its argument. For example,

transpose 
  (NonEmptyArray [ NonEmptyArray [1, 2, 3]
                 , NonEmptyArray [4, 5, 6]
                 ]) == 
  (NonEmptyArray [ NonEmptyArray [1, 4]
                 , NonEmptyArray [2, 5]
                 , NonEmptyArray [3, 6]
                 ])

If some of the rows are shorter than the following rows, their elements are skipped:

transpose 
  (NonEmptyArray [ NonEmptyArray [10, 11]
                 , NonEmptyArray [20]
                 , NonEmptyArray [30, 31, 32]
                 ]) == 
  (NomEmptyArray [ NonEmptyArray [10, 20, 30]
                 , NonEmptyArray [11, 31]
                 , NonEmptyArray [32]
                 ])
transpose :: forall a. List (List a) -> List (List a)

The 'transpose' function transposes the rows and columns of its argument. For example,

transpose ((1:2:3:Nil) : (4:5:6:Nil) : Nil) ==
  ((1:4:Nil) : (2:5:Nil) : (3:6:Nil) : Nil)

If some of the rows are shorter than the following rows, their elements are skipped:

transpose ((10:11:Nil) : (20:Nil) : Nil : (30:31:32:Nil) : Nil) ==
  ((10:20:30:Nil) : (11:31:Nil) : (32:Nil) : Nil)
transpose :: forall a. List (List a) -> List (List a)

The 'transpose' function transposes the rows and columns of its argument. For example,

transpose ((1:2:3:nil) : (4:5:6:nil) : nil) ==
  ((1:4:nil) : (2:5:nil) : (3:6:nil) : nil)

If some of the rows are shorter than the following rows, their elements are skipped:

transpose ((10:11:nil) : (20:nil) : nil : (30:31:32:nil) : nil) ==
  ((10:20:30:nil) : (11:31:nil) : (32:nil) : nil)
unfoldM :: forall m a. Monad m => m (Maybe a) -> m (Array a)

The supplied Maybe expression will be repeatedly called until it returns Nothing. All values returned are collected into an Array.

unfoldM :: forall m a. MonadRec m => m (Maybe a) -> m (Array a)

The supplied Maybe expression will be repeatedly called until it returns Nothing. All values returned are collected into an array.

headA :: forall repr a. DataDSL repr => repr (Array a) -> repr (Maybe a)

Get first element

swap :: forall @m @n a. Swap m n a => Polynomial (Polynomial a) -> Polynomial (Polynomial a)
xchng :: forall a. Eq a => Semiring a => Polynomial (Polynomial a) -> Polynomial (Polynomial a)
getBounds :: forall a. Array (Array a) -> { maxX :: Int, maxY :: Int }
solve :: Board (Maybe Int) -> Array (Board Int)

The solve function literally solves a Sudoku question board, returns an array of complete solutions.

transpose :: forall a. Array (Array a) -> Array (Array a)
transpose :: forall a. Array (Array a) -> Array (Array a)
mergeMany :: forall f a. Functor f => Foldable f => f (Signal a) -> Maybe (Signal a)

Merge all signals inside a Foldable, returning a Maybe which will either contain the resulting signal, or Nothing if the Foldable was empty.

shift :: forall a. Stream (Stream a) -> Now (Stream a)

Takes a stream of a stream and returns a stream that emits from the last stream.

shiftFrom :: forall a. Stream (Stream a) -> Behavior (Stream a)

Takes a stream of a stream and returns a stream that emits from the last stream.

switchC :: forall cel a. SodiumCell cel => cel (Cell a) -> Effect (Cell a)
race :: forall a. Array (Promise a) -> Effect (Promise a)
race :: forall a. Array (Promise a) -> Effect (Promise a)
addLayers :: forall node. Ord node => Array (TaskNode node) -> Array (LayeredNode node)

Add layer information to task nodes

fromArray :: forall a. Array (Array a) -> Maybe (Matrix a)

Constructs a Matrix from an Array of Arrays. Returns Nothing if the dimensions don't line up.

> fromMaybe empty (fromArray [[1,2,3], [4,5,6]])
1, 2, 3
4, 5, 6

> fromArray [[1,2,3], [4,5]]
Nothing
layoutTree :: forall a. Tree (WithDef a) -> Tree (WithDefRect a)
fromSendable :: forall a. SendWrapper (SharedMap a) -> Effect (SharedMap a)

Unwrap on the worker side. Reconstructs Int32Array views from the shared buffer.

fromSendable :: forall a. SendWrapper (SharedState a) -> Effect (SharedState a)

Unwrap on the worker side. Reconstructs Int32Array views from the shared buffer.

maximum :: forall c. Array (Money c) -> Maybe (Money c)

Find the maximum of an array of money amounts.

minimum :: forall c. Array (Money c) -> Maybe (Money c)

Find the minimum of an array of money amounts.

unwrapResponse :: forall a. Aff (ClientResponse a) -> Aff (ResponseContent a)
length :: forall da a. Patch a da => Jet (IArray a) -> Jet (Atomic Int)

Compute the length of the array incrementally.

text :: forall eff. Jet (Atomic String) -> Jet (View eff)

Create a text node wrapped in a <span> element.

withered :: forall t m x. Witherable t => Applicative m => t (m (Maybe x)) -> m (t x)

Filter out all the Nothing values - with effects in m.

memo :: forall props. Effect (ReactComponent props) -> Effect (ReactComponent props)

Prevents a component from re-rendering if its new props are referentially equal to its old props (not value-based equality -- this is due to the underlying React implementation). Prefer memo' for more PureScript-friendldy behavior.

negateA :: forall repr. DataDSL repr => repr (Array Number) -> repr (Array Number)

Negate all values in array

Spreadsheet equivalent: =MAP(range, x => -x)

jsonify :: forall k. EncodeJson k => Options (IteratorOptions k) -> Options (IteratorOptions k)
sort :: forall a. List (Stamped a) -> List (Stamped a)

Sort a list of Stamped records ascending chronologically.

separate :: forall f l r. Compactable f => f (Either l r) -> { left :: f l, right :: f r }
separateDefault :: forall f l r. Functor f => Compactable f => f (Either l r) -> { left :: f l, right :: f r }
partition :: forall c b f. Rebuildable f => f (Either b c) -> { left :: f b, right :: f c }
flatten :: forall a f. Functor f => Foldable f => Signal (f a) -> a -> Signal a

Turns a signal of collections of items into a signal of each item inside each collection, in order.

treePath :: forall node r. Ord node => { depth :: Map node Int, parent :: Map node node | r } -> node -> Array node

The route the search took to a node, start node first.

Empty for a node the search never reached — there is no such route, and a singleton array would be a lie about a node that is merely isolated.

Row-polymorphic in the rest of the record so that anything which contains a search tree — Data.Graph.InducedTree.Induced, say — can be walked directly rather than having one carved back out of it.

arrayToTree :: forall d. { getId :: d -> NodeID, getParentId :: d -> Maybe NodeID, nodes :: Array d } -> Either String (Tree d)

Build a Tree from an array of nodes with parent pointers

This function constructs a tree from a flat array where each node knows its parent ID. Useful for loading hierarchical data from databases or JSON where parent-child relationships are encoded as references.

Example:

let nodes = [
  {id: "1", parentId: Nothing, name: "Root"},
  {id: "2", parentId: Just "1", name: "Child 1"},
  {id: "3", parentId: Just "1", name: "Child 2"}
]
let tree = arrayToTree {
  nodes: nodes,
  getId: _.id,
  getParentId: _.parentId
}

Returns Left with error message if:

  • No root node found (node with Nothing parent)
  • Multiple root nodes found
  • Circular references detected
genVeitherFrequncy :: forall a errorRows otherGenRows rowList. RowToList (_ :: Tuple Number (Gen a) | otherGenRows) rowList => GenVariantFrequency (_ :: Tuple Number (Gen a) | otherGenRows) Number rowList (_ :: a | errorRows) => { _ :: Tuple Number (Gen a) | otherGenRows } -> Gen (Veither errorRows a)

Generate Veither with user-specified probability given a record whose generators' labels correspond to the Veither's labels

-- Note: type annotations are needed! Otherwise, you'll get compiler errors.
quickCheckGen do
  v <- genVeitherFrequency
     -- first approach: annotate inline
     { "_": genHappyPath :: Gen Int
     , x: genXValues :: Gen (Maybe String)
     , y: pure "foo" :: Gen String
     }
  -- rest of test...

quickCheckGen do
  let
    -- second approach: use a let with annotations before usage
    r :: { "_" :: Gen Int, x :: Gen (Maybe String), y :: Gen String }
    r = { "_": genHappyPath, x: genXValues, y: pure "foo" }
  v <- genVeitherFrequency r
  -- rest of test...
genVeitherUniform :: forall a errorRows otherGenRows rowList. RowToList (_ :: Gen a | otherGenRows) rowList => GenVariantUniform (_ :: Gen a | otherGenRows) rowList (_ :: a | errorRows) => { _ :: Gen a | otherGenRows } -> Gen (Veither errorRows a)

Generate Veither with uniform probability given a record whose generators' labels correspond to the Veither's labels

-- Note: type annotations are needed! Otherwise, you'll get compiler errors.
quickCheckGen do
  v <- genVeitherUniform
     -- first approach: annotate inline
     { "_": genHappyPath :: Gen Int
     , x: genXValues :: Gen (Maybe String)
     , y: pure "foo" :: Gen String
     }
  -- rest of test...

quickCheckGen do
  let
    -- second approach: use a let with annotations before usage
    r :: { "_" :: Gen Int, x :: Gen (Maybe String), y :: Gen String }
    r = { "_": genHappyPath, x: genXValues, y: pure "foo" }
  v <- genVeitherUniform r
  -- rest of test...
customControl :: forall value. { fromStr :: String -> Maybe value, render :: value -> (value -> Effect Unit) -> JSX, toStr :: value -> String } -> value -> CustomControl value
fetchQuery :: forall @output. Flatten output output => { queryFn :: Aff output, queryKey :: QueryKey } -> QueryClient -> Aff output
fromGenericContent :: forall r f. Monad f => { fileContent :: f String, throw :: forall a. String -> f a | r } -> f (Map Char EnrichedPos)

Reads configuration from generic content.

gcast1 :: forall s t a c. Typeable (s a) => Typeable (t a) => c (s a) -> Maybe (c (t a))
logDefault :: forall m a. MonadEffect m => Loggable a => { level :: LogSeverity, severity :: LogSeverity } -> a -> m Unit
makeNetwork_ :: forall l n _e _v d. IsDiagram d => LayoutNetwork l n _e _v => Variant (diagram :: d, group :: Group_, parts :: Iterator_ Part_) -> l -> Effect n
parseDirectionX :: forall r f. Applicative f => { throw :: forall a. String -> f a | r } -> String -> f DirectionX
parseDirectionY :: forall r f. Applicative f => { throw :: forall a. String -> f a | r } -> String -> f DirectionY
parseInt :: forall r f. Applicative f => { throw :: forall a. String -> f a | r } -> String -> f Int
parseOriginX :: forall r f. Applicative f => { throw :: forall a. String -> f a | r } -> String -> f OriginX
parseOriginY :: forall r f. Applicative f => { throw :: forall a. String -> f a | r } -> String -> f OriginY
playAnimation :: forall a. Sprite a => { ignoreIfPlaying :: Boolean, key :: String } -> a -> Effect a
sendDiagnostics :: forall m. MonadAff m => { diagnostics :: Array Diagnostic, uri :: String } -> Connection -> m Unit
SetDimensions :: forall a. { height :: Int, width :: Int } -> a -> EChartsQuery a
size :: forall l d. GraphLayout l => { height :: Number, width :: Number | d } -> l -> D3Eff l
flattenArray :: forall a. Signal (Array a) -> a -> Signal a

Turns a signal of arrays of items into a signal of each item inside each array, in order.

Like flatten, but faster.

setOrientation :: { x :: Number, y :: Number, z :: Number } -> PannerNode -> Effect Unit
setPosition :: { x :: Number, y :: Number, z :: Number } -> AudioListener -> Effect Unit
setPosition :: { x :: Number, y :: Number, z :: Number } -> PannerNode -> Effect Unit
settled :: { acceleration :: Number, step :: Number } -> Watch -> Effect Boolean

Is the layout at rest? True when, over the last two ticks, no node moved further than step in a tick and no node's step changed by more than acceleration. False until two ticks have been seen.

createConsumer :: forall opts opts_. Union opts opts_ ConsumerOptionsImpl => { groupId :: ConsumerGroupId | opts } -> Kafka -> Effect Consumer
createTopics :: { topics :: Array TopicConfig } -> Admin -> Aff Boolean
deleteTopics :: { topics :: Array TopicName } -> Admin -> Aff Unit
guardBranch :: forall e f expr. ToNonEmptyArray f => ToWhere expr e => f (PatternGuard e) -> expr -> GuardedBranch e

Constructs a guarded branch in a value binding or case expressions. This can be used anwhere that takes a ToGuarded constraint.

exampleDecl =
  declValue "countDown" [ binderVar "n" ]
    [ guardBranch [ guardExpr (exprOp (exprIdent "n") [ binaryOp ">" (exprInt 0) ]) ]
        ( exprApp (exprIdent "countDown")
            [ exprOp (exprIdent "n") [ binaryOp "-" (exprInt 1) ] ]
        )
    , guardBranch [ guardExpr (exprIdent "otherwise") ]
        (exprIdent "n")
    ]
subscribe :: forall opts opts_. Union opts opts_ SubscribeOptionsImpl => { topic :: TopicName | opts } -> Consumer -> Aff Unit
addPoint :: { x :: Number, y :: Number } -> PhaserCurveSpline -> Effect PhaserCurveSpline
calculateFacesAt :: { x :: Int, y :: Int } -> PhaserTileMap -> Effect PhaserTileMap
cancelQueries :: { queryKey :: QueryKey } -> QueryClient -> Aff Unit
canShowContextMenu_ :: forall graphObject diagram. IsGraphObject graphObject => IsDiagram diagram => Variant (diagram :: diagram, graphObject :: graphObject) -> CommandHandler_ -> Effect Boolean
checkGoldenWithDiff :: { actual :: String, diffDir :: String, goldenDir :: String, testName :: String } -> Aff (Either String Unit)
chmod :: { dest :: String, mode :: String } -> SftpClientRef -> EffectFnAff Unit
createTable :: forall opts opts_. Union opts opts_ CreateTableOptionsImpl => { attributeDefinitions :: Array AttributeDefinition, keySchema :: Array KeySchemaElement, tableName :: TableName | opts } -> DynamoDB -> Aff Foreign
debug :: forall w. Wrapper w => { ignoreProps :: Boolean, verbose :: Boolean } -> w -> Effect String

Returns an HTML-like string of the wrapper for debugging purposes. Useful to print out to the console when tests are not passing when you expect them to.

defaultRenderForest :: { forceTopLabels :: Boolean } -> Forest -> Array JSX
doLayout_ :: forall l d. IsLayout l => Variant (diagram :: d, group :: Group_, parts :: Iterator_ Part_) -> l -> Effect Unit
fastGet :: { local :: String, remote :: String } -> SftpClientRef -> EffectFnAff Unit
fastPut :: { local :: String, remote :: String } -> SftpClientRef -> EffectFnAff Unit
getSession :: { headers :: WebHeaders } -> Api -> Aff SessionWithUser
highlightCollection_ :: forall d p. IsDiagram d => IsPart p => Variant (array :: Array Part_, iterator :: Iterator_ Part_) -> d -> Effect Unit
invalidateQueries :: { queryKey :: QueryKey } -> QueryClient -> Effect Unit

QueryClient methods

isFetching :: { queryKey :: QueryKey } -> QueryClient -> Effect Int
isMutating :: { queryKey :: QueryKey } -> QueryClient -> Effect Int
mkdir :: { path :: String, recursive :: Boolean } -> SftpClientRef -> EffectFnAff Unit
mutedRanges :: { lines :: Array String } -> Map RuleId (Array MutedRange)

Given lines of a code file, finds ranges and/or lines marked with #disable/#enable directives, and returns those ranges grouped by rule.

For example:

-- #disable SomeRule
foo -- #disable AnotherRule
bar
-- #enable SomeRule
baz
qux -- #disable SomeRule

Would return:

{
  SomeRule: [MutedRange 0 3, MutedLine 5],
  AnotherRule: [MutedLine 1]
}
prefetchQuery :: forall @output. Flatten output output => { queryFn :: Aff output, queryKey :: QueryKey } -> QueryClient -> Aff Unit
refetchQueries :: { queryKey :: QueryKey } -> QueryClient -> Aff Unit
removeQueries :: { queryKey :: QueryKey } -> QueryClient -> Effect Unit
rename :: { from :: String, to :: String } -> SftpClientRef -> EffectFnAff Unit
requestAddr :: { ipv4 :: String -> Int -> SocketAddress, ipv6 :: String -> Int -> SocketAddress } -> IncomingMessage -> Effect SocketAddress
resetQueries :: { queryKey :: QueryKey } -> QueryClient -> Aff Unit
rmdir :: { path :: String, recursive :: Boolean } -> SftpClientRef -> EffectFnAff Unit
scrollTo :: { x :: Int, y :: Int } -> Scrollable -> Effect Unit
scrollTo' :: { animated :: Boolean, x :: Int, y :: Int } -> Scrollable -> Effect Unit
selectCollection_ :: forall d p. IsDiagram d => IsPart p => Variant (array :: Array Part_, iterator :: Iterator_ Part_) -> d -> Effect Unit
sendOtpToEmail :: { email :: UserEmail } -> Client -> Aff AuthResponse
sendOtpToPhone :: { phone :: UserPhone } -> Client -> Aff AuthResponse
sendSms :: { message :: String, msgType :: MessageType, to :: String } -> SmsApi -> Aff Unit

Requests simple sms send.

setSession :: { access_token :: AccessToken, refresh_token :: RefreshToken } -> Client -> Aff AuthResponse
showContextMenu_ :: forall graphObject diagram. IsGraphObject graphObject => IsDiagram diagram => Variant (diagram :: diagram, graphObject :: graphObject) -> CommandHandler_ -> Effect Unit
signInEmail :: { email :: Email, password :: Password } -> Api -> Aff SignInResult
signInSocial :: forall opts opts_. Union opts opts_ SignInSocialOptionsImpl => { provider :: ProviderId | opts } -> Api -> Aff SignInSocialResult
signInWithEmail :: { email :: UserEmail, password :: UserPassword } -> Client -> Aff AuthResponse
signInWithIdToken :: { provider :: OAuthProvider, token :: IdToken } -> Client -> Aff AuthResponse
signInWithPhone :: { password :: UserPassword, phone :: UserPhone } -> Client -> Aff AuthResponse
signUpEmail :: { email :: Email, name :: UserName, password :: Password } -> Api -> Aff SignUpResult
signUpWithEmail :: { email :: UserEmail, password :: UserPassword } -> Client -> Aff AuthResponse
signUpWithPhone :: { password :: UserPassword, phone :: UserPhone } -> Client -> Aff AuthResponse
startServer :: { distDir :: String } -> Int -> Aff Unit
toArtStudio :: { cells :: Array (Array HiresCell), image :: Array (Array RGB) } -> Either String (Array Int)

A dithered hires screen as an Art Studio file, .art: the format of the C64's best-known hires paint program, which many viewers and converters open.

  • { cells, image }: what Puregrain.Cells.ditherCells returns with this module's hiresScreen, for a 320 × 200 picture.
bytes = toArtStudio (ditherCells noDiffusion (orderedInCell m) hiresScreen picture)

The file is 9009 bytes: the address it loads at, 8192 ($2000); the bitmap, 8000 bytes; the cells' colors, 1000 bytes, both as in toHiresPrg; and 7 filler bytes, zeros, as long as Art Studio's own files.

Left, with a message, as for toHiresPrg.

toHiresPrg :: { cells :: Array (Array HiresCell), image :: Array (Array RGB) } -> Either String (Array Int)

A dithered hires screen as a .prg file: a C64 program that shows the picture by itself. Open it in an emulator, which starts it, or load and run it on a C64 (LOAD "name",8 and RUN). The picture stays until a key is pressed; then the screen is as it was.

  • { cells, image }: what Puregrain.Cells.ditherCells returns with this module's hiresScreen, for a 320 × 200 picture.
bytes = toHiresPrg (ditherCells noDiffusion (orderedInCell m) hiresScreen picture)

The file is 14,145 bytes: the address it loads at, 2049 ($0801), where BASIC programs start, and from there a short BASIC program, the viewer; the cells' colors at 3072 ($0C00), one byte per cell, row by row: foreground × 16 + background; and the bitmap at 8192 ($2000), one bit per pixel (1 for the foreground, 0 for the background, the leftmost pixel in the highest bit), each cell's 8 bytes in a row, the cells row by row. Zeros fill the gaps. A single-color cell has all its bits 0. The viewer points the video chip at the colors and the bitmap where they are, and puts everything back after a key. Its border takes the color most frequent along the picture's edge, the 1,036 outermost pixels, so that it continues the picture rather than framing it; on a tie, the lowest color code, so black wins every tie it's in.

Left, with a message, for an image that isn't 320 × 200, for cells that don't form the matching 40 × 25 grid, or for a pixel that isn't one of its cell's colors: then the cells weren't chosen for this image.

toPlainDate :: { year :: Int } -> PlainMonthDay -> Effect PlainDate

Converts to PlainDate by supplying a year.

exampleToPlainDate :: Effect Unit
exampleToPlainDate = do
  locale <- JS.Intl.Locale.new_ "en-US"
  birthday <- PlainMonthDay.fromString "12-15"
  birthdayIn2030 <- PlainMonthDay.toPlainDate { year: 2030 } birthday
  formatter <- JS.Intl.DateTimeFormat.new [ locale ] { dateStyle: "long" }
  Console.log ("Birthday in 2030: " <> JS.Intl.DateTimeFormat.format formatter birthdayIn2030)

Birthday in 2030: December 15, 2030
toPlainDate :: { day :: Int } -> PlainYearMonth -> Effect PlainDate

Converts to PlainDate by supplying a day.

exampleToPlainDate :: Effect Unit
exampleToPlainDate = do
  locale <- JS.Intl.Locale.new_ "en-US"
  yearMonth <- PlainYearMonth.fromString "2024-01"
  firstDay <- PlainYearMonth.toPlainDate { day: 1 } yearMonth
  formatter <- JS.Intl.DateTimeFormat.new [ locale ] { dateStyle: "long" }
  Console.log (JS.Intl.DateTimeFormat.format formatter firstDay)

January 1, 2024
toScr :: { cells :: Array (Array Attribute), image :: Array (Array RGB) } -> Either String (Array Int)

A dithered screen as a .scr file: the 6912 bytes of the Spectrum's screen memory, as SAVE "name" SCREEN$ saves them, and as many emulators and tools open them.

  • { cells, image }: what Puregrain.Cells.ditherCells returns with this module's screen, for a 256 × 192 picture.
bytes = toScr (ditherCells noDiffusion (orderedInCell m) screen picture)

The first 6144 bytes are the bitmap, one bit per pixel (1 for the ink, 0 for the paper, the leftmost pixel in the highest bit), its rows in the Spectrum's interleaved order. Then come 768 attribute bytes, one per cell, row by row: BRIGHT × 64 + paper × 8 + ink, with FLASH off. A single-color cell has all its bits 0.

Left, with a message, for an image that isn't 256 × 192, for cells that don't form the matching 32 × 24 grid, or for a pixel that isn't one of its cell's colors: then the cells weren't chosen for this image.

verifyEmailOtp :: { email :: UserEmail, token :: OTPToken, type :: OTPType } -> Client -> Aff AuthResponse
verifyPhoneOtp :: { phone :: UserPhone, token :: OTPToken, type :: OTPType } -> Client -> Aff AuthResponse
with :: { day :: Int, month :: Int } -> PlainMonthDay -> Maybe PlainMonthDay

Create a modified copy with the given month and day. Returns Nothing if the result would be invalid.

with :: { month :: Int, year :: Int } -> PlainYearMonth -> Maybe PlainYearMonth

Create a modified copy with the given year and month. Returns Nothing if the result would be invalid.

wrap :: { factor :: Number, most :: Int, size :: Number, width :: Number } -> String -> Array String

A string as lines no wider than width (as estimated, factor times over), at most most of them (and at least one).

hoistLiftApp :: forall f g a. f (g a) -> f (App g a)
hoistLowerApp :: forall f g a. f (App g a) -> f (g a)
useAff :: forall m a. MonadHooks m => Signal (Aff a) -> m (Signal (Maybe a))

Unwrap Aff Signal. If the order of the results is reversed, it is ignored.

asyncRequest :: forall m a. MonadEffect m => MonadFRP m => Dynamic (Aff a) -> m (Dynamic (RequestState a))

Like asyncRequestMaybe, but without the Nothing case.

latestJust :: forall m a. MonadFRP m => Dynamic (Maybe a) -> m (Dynamic (Maybe a))

Returns a Dynamic that holds the latest Just value of the input Dynamic after execution of this function. If the input currently has value Nothing, the resulting Dynamic will have the value Nothing until the input changes to a Just.

The resulting Dynamic changes when the input changes to a value that is a Just, and doesn't change when the input changes to Nothing.

Query :: forall a. (List (SqlDeclF a)) -> a -> SqlQueryF a
useAff :: forall m a. MonadHooks m => Signal (Aff a) -> m (Signal (Maybe a))

Unwrap Aff Signal. If the order of the results is reversed, it is ignored.