-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
In purescript/purescript-unsafe-coerce#11, we removed the below documentation because that should go here now. This is a reminder to add that to this repo.
-- | One application for this function is to avoid doing work that you know is a
-- | no-op because of newtypes. For example, if you have an `Array (Conj a)` and you
-- | want an `Array (Disj a)`, you could do `Data.Array.map (runConj >>> Disj)`, but
-- | this performs an unnecessary traversal. `coerce` accomplishes the same
-- | for free.
-- |
-- | It is highly recommended to define specializations of this function rather than
-- | using it as-is. For example:
-- |
-- | ```purescript
-- | mapConjToDisj :: forall a. Array (Conj a) -> Array (Disj a)
-- | mapConjToDisj = coerce
-- | ```
Metadata
Metadata
Assignees
Labels
No labels