Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Commit

Permalink
feat(utils): added a tiny alias of # to |>
Browse files Browse the repository at this point in the history
  • Loading branch information
prescientmoon committed Oct 27, 2020
1 parent 4113f9c commit 0d58cf9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions packages/utils/src/Function.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- | Don't kill me please
module Lunarflow.Pipe where

import Data.Function (applyFlipped)

-- infixr 0 apply as <|
infixl 1 applyFlipped as |>
4 changes: 2 additions & 2 deletions packages/utils/src/List.purs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import Data.List (List(..), length, mapWithIndex, (!!), (..), (:))
import Data.Maybe (fromMaybe)
import Data.Tuple (Tuple(..))

-- | Merge 2 lists elements by element.
-- | Merge 2 lists element by element.
merge :: forall a. (a -> a -> a) -> List a -> List a -> List a
merge f = case _, _ of
Nil, list -> list
list, Nil -> list
(x : xs), (y : ys) -> f x y : merge f xs ys

-- | Kinda lika List.insert but adds an arbitrary empty value as much
-- | Kinda like List.insert but adds an arbitrary empty value as much
-- | as needed until the value we want to add can actually be inserted safely.
with :: forall a. Int -> a -> a -> List a -> List a
with index empty value list =
Expand Down

0 comments on commit 0d58cf9

Please sign in to comment.