on e00a3f3 help sign in
elk/src/Elm/Utils.hs
35 lines 567 B history raw
1{-# OPTIONS_GHC -Wall #-}
2module Elm.Utils
3 ( (|>), (<|)
4 , nearbyNames
5 , Entry(..)
6 , parseEntry
7 )
8 where
11import Parse.Repl (Entry(..), parseEntry)
12import Reporting.Helpers (nearbyNames)
16-- PIPES
19{-| Forward function application `x |> f == f x`. This function is useful
20for avoiding parenthesis and writing code in a more natural way.
21-}
22(|>) :: a -> (a -> b) -> b
23x |> f = f x
26{-| Backward function application `f <| x == f x`. This function is useful for
27avoiding parenthesis.
28-}
29(<|) :: (a -> b) -> a -> b
30f <| x = f x
33infixr 0 <|
34infixl 0 |>