From 90badda2f8ef96069fae3a00d1726237783b0209 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Sat, 28 Nov 2020 09:25:29 -0500 Subject: Enable rudimentary remote builds --- Alpha.hs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Alpha.hs') diff --git a/Alpha.hs b/Alpha.hs index 8b79c4c..556f8df 100644 --- a/Alpha.hs +++ b/Alpha.hs @@ -40,11 +40,16 @@ module Alpha joinWith, CanSnakeCase (snake), + -- * String + capitalize, + -- * Debugging tools say, ) where +import qualified Data.Char as Char +import qualified Data.List as List import Data.String import Data.Text (Text) import qualified Data.Text as Text @@ -68,14 +73,14 @@ f b) -> a -> b -f <| g = f (g) +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) +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 @@ -106,3 +111,7 @@ class CanSnakeCase str where instance CanSnakeCase Text where snake = Text.replace " " "-" . Text.toLower + +capitalize :: String -> String +capitalize [] = [] +capitalize str = (Char.toUpper <| List.head str) : (Char.toLower