diff options
Diffstat (limited to 'Alpha.hs')
-rw-r--r-- | Alpha.hs | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -46,13 +46,11 @@ module Alpha ) where -import Data.Function ((&)) -import Data.Functor ((<&>)) import Data.String import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.Lazy as LazyText -import Protolude as X +import Protolude as X hiding (($), (&)) -- | Debugging printf say :: Text -> IO () @@ -60,7 +58,7 @@ say = putText -- | Alias for map, fmap, <$> (</) :: Functor f => (a -> b) -> f a -> f b -(</) = fmap +f </ g = fmap f g -- | Double fmap. A function on the left goes "into" two functors -- (i.e. it goes "two levels deep"), applies the function to the inner @@ -71,20 +69,20 @@ say = putText -- | Normal function application. Do the right side, then pass the -- return value to the function on the left side. (<|) :: (a -> b) -> a -> b -(<|) = ($) +f <| g = f (g) infixr 0 <| -- | Reverse function application. Do the left side, then pass the -- return value to the function on the right side. (|>) :: a -> (a -> b) -> b -(|>) = (&) +f |> g = g (f) -- | Alias for <&>. Can be read as "and then". Basically does into a -- functor, does some computation, then returns the same kind of -- functor. Could also be defined as `f >>= return . g` (/>) :: Functor f => f a -> (a -> b) -> f b -(/>) = (<&>) +f /> g = fmap g f -- | Removes newlines from text. chomp :: Text -> Text |